Files
mgmt/lang/interpret_test/TestAstFunc1/polydoubleinclude.txtar
James Shubin 28f5b8331a lang: funcs: structs: Improve naming
These could print nicer for debugging.
2024-12-08 16:24:42 -05:00

39 lines
954 B
Plaintext

-- main.mcl --
import "fmt"
# note that the class can have two separate types for $b
include c1("t1", "hello") # len is 5
include c1("t2", [13, 42, 0, -37,]) # len is 4
class c1($a, $b) {
test "${a}" {
anotherstr => fmt.printf("len is: %d", len($b)),
}
}
-- OUTPUT --
Edge: FuncValue -> call # fn
Edge: FuncValue -> call # fn
Edge: FuncValue -> call # fn
Edge: FuncValue -> call # fn
Edge: const: int(-37) -> composite: []int # 3
Edge: const: int(0) -> composite: []int # 2
Edge: const: int(13) -> composite: []int # 0
Edge: const: int(42) -> composite: []int # 1
Vertex: FuncValue
Vertex: FuncValue
Vertex: FuncValue
Vertex: FuncValue
Vertex: call
Vertex: call
Vertex: call
Vertex: call
Vertex: composite: []int
Vertex: const: int(-37)
Vertex: const: int(0)
Vertex: const: int(13)
Vertex: const: int(42)
Vertex: const: str("hello")
Vertex: const: str("len is: %d")
Vertex: const: str("len is: %d")
Vertex: const: str("t1")
Vertex: const: str("t2")