lang: Port TestAstFunc1 to txtar format

This commit is contained in:
James Shubin
2023-06-01 16:11:47 -04:00
parent 8fffd10280
commit 66edf22ea3
121 changed files with 656 additions and 558 deletions

View File

@@ -0,0 +1,30 @@
-- main.mcl --
import "fmt"
# we should only see one copy of $fn
$fn = func() {
"hello world"
}
test "greeting1" {
anotherstr => $fn(),
}
test "greeting2" {
anotherstr => $fn(),
}
test "greeting3" {
anotherstr => $fn(),
}
-- OUTPUT --
Edge: func() { str("hello world") } -> call:fn() # call:fn
Edge: func() { str("hello world") } -> call:fn() # call:fn
Edge: func() { str("hello world") } -> call:fn() # call:fn
Edge: str("hello world") -> func() { str("hello world") } # body
Vertex: call:fn()
Vertex: call:fn()
Vertex: call:fn()
Vertex: func() { str("hello world") }
Vertex: str("greeting1")
Vertex: str("greeting2")
Vertex: str("greeting3")
Vertex: str("hello world")