aboutsummaryrefslogtreecommitdiff
path: root/tools/parse.nom
diff options
context:
space:
mode:
Diffstat (limited to 'tools/parse.nom')
-rwxr-xr-xtools/parse.nom8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/parse.nom b/tools/parse.nom
index 68be3a8..35613d2 100755
--- a/tools/parse.nom
+++ b/tools/parse.nom
@@ -1,6 +1,7 @@
-#!/usr/bin/env nomsu -V2.4.4.3
+#!/usr/bin/env nomsu -V2.5.4.3
use "core"
use "lib/os.nom"
+
action [print tree %t at indent %indent]:
if %t.type is:
"Action":
@@ -8,12 +9,13 @@ action [print tree %t at indent %indent]:
for %arg in %t:
if (%arg is syntax tree):
print tree %arg at indent "\%indent "
+
"Number":
- say "\(%indent)\(%t.1)"
+ say "\%indent\(%t.1)"
"Var":
say "\(%indent)%\(%t.1)"
else:
- say "\(%indent)\(%t.type):"
+ say "\%indent\(%t.type):"
for %arg in %t:
if:
(%arg is syntax tree):