Files
mgmt/lang/interpret_test/TestAstFunc2/func-gen2.txtar
James Shubin 55eeb50fb4 lang: Refactor all the highlight helping together
Keep this cleaner and add a bit more.
2025-06-07 17:52:15 -04:00

18 lines
491 B
Plaintext

-- main.mcl --
# This sort of thing is not currently supported, and not sure if it ever will.
# test generating a function with outside scoping
$const1 = "hello"
class funcgen2 {
func fun2() {
$const1 + " " + $const2
}
}
$const2 = "world" # added here to confirm any-order rules
include funcgen2
$x2 = fun2() # not funcgen2.fun2 since it's *not* an import!
test "${x2}" {} # hello world
-- OUTPUT --
# err: errSetScope: func `fun2` does not exist in this scope: /main.mcl @ 13:7-13:13