Debian Codegraph @

lang/interpret_test/TestAstFunc2/printfinterpolate0.txtar

raw
1 -- main.mcl --
2 import "fmt"
3
4 $str1 = "big"
5 $str2 = "world"
6
7 # FIXME: We'd like to pre-compute the interpolation if we can, so that we can
8 # check this code statically... For now, we can't, so it's only possible with
9 # the PrintfAllowNonStaticFormat option enabled. This isn't bad per se, however
10 # any static compilation/optimization we can by "running early" would be great.
11 test [fmt.printf("hello ${str1} %s", $str2),] {}
12 test ["hello " + "small" + " " + $str2,] {}
13 print "print1" {
14 msg => fmt.printf("hello ${str1} %s", $str2),
15 }
16 -- OUTPUT --
17 Vertex: test[hello big world]
18 Vertex: test[hello small world]
19 Vertex: print[print1]