Files
mgmt/lang/interpret_test/TestAstFunc2/panic1.txtar
James Shubin 2cbce963b7 engine: resources, lang: funcs, parser: Add panic magic
It's valuable to check your runtime values and to shut down the entire
engine in case something doesn't match. This patch adds some magic
plumbing to support a "panic" mechanism.

A new "panic" statement gets transparently converted into a panic
function and panic resource. The former errors if the input is not
empty. The latter must be present to consume the value, but doesn't
actually do anything.
2023-11-28 13:49:31 -05:00

8 lines
121 B
Plaintext

-- main.mcl --
# This should not panic.
panic("")
test "hello" {}
-- OUTPUT --
Vertex: _panic[panic]
Vertex: test[hello]