code / nomsu

Lines6.6K Lua5.1K PEG1.3K make117
2 others 83
Markdown60 Bourne Again Shell23
(55 lines)
1 #!/usr/bin/env nomsu -V7.0.0
2 ###
3 This file defines upgrades from Nomsu <7 to 7
5 use "compatibility/compatibility"
7 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9 upgrade action ($tree with $t -> $replacement) to "7" as
10 $tree, with ($t -> $replacement)
12 upgrade action [
13 tree $tree with vars $replacements, $tree with vars $replacements
14 ] to "7" as ($tree, with $replacements)
16 upgrade action ($tree has subtree $match_tree) to "7" as
17 $tree, contains $match_tree
19 upgrade action (for $var in $iterable at $i $body) to "7" as
20 for ($i = $var) in $iterable $body
22 upgrade action (for $k = $v in $iterable $body) to "7" as
23 for ($k = $v) in $iterable $body
25 upgrade action [
26 for $var in $start to $stop by $step $body
27 for $var in $start to $stop via $step $body
28 ] to "7" as (for $var in ($start to $stop by $step) $body)
30 upgrade action (for $var in $start to $stop $body) to "7" as
31 for $var in ($start to $stop) $body
33 upgrade $tree to "7" as:
34 if ($tree.type == "EscapedNomsu"):
35 $t =
36 "Action" tree from $tree.source with ("Text" tree with $tree.1.type) "tree"
37 "with"
39 for $tok in $tree.1:
40 if ($tok is "Text"):
41 $t, add ("Text" tree with $tok)
42 ..else:
43 $t, add $tok
45 return $t
47 upgrade action "Nomsu version" to "7" via ->(\$(NOMSU VERSION))
48 upgrade action [
49 "Nomsu syntax version", "Nomsu compiler version", "core version", "lib version"
50 ] to "7" via
51 for $:
52 at $.source fail ("
53 Deprecation error: Actions for accessing specific parts of the version number have been deprecated.
54 Hint: Use $(NOMSU VERSION).1, etc. instead.