diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-01-11 04:38:46 -0800 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-01-11 04:38:46 -0800 |
| commit | 3fbc89273dbebadf5e70197a51ddfae3131202c4 (patch) | |
| tree | c15cd9aa121bfda34be46103a6cc4e706e3042db /lib/training_wheels.nom | |
| parent | 756c1f718ee427d89e5fdbfae00f760b89f793eb (diff) | |
Removed some dead code and streamlined the API a bit. Also added
training wheels for ease of transitions.
Diffstat (limited to 'lib/training_wheels.nom')
| -rw-r--r-- | lib/training_wheels.nom | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/training_wheels.nom b/lib/training_wheels.nom new file mode 100644 index 0000000..e5fec96 --- /dev/null +++ b/lib/training_wheels.nom @@ -0,0 +1,22 @@ +use "lib/core.nom" + +parse [%a == %b] as: %a is %b +parse [%a ~= %b, %a != %b, %a <> %b] as: %a is not %b +parse [%a === %b] as: (%a's id) is (%b's id) +parse [%a !== %b] as: (%a's id) is not (%b's id) +parse [%a mod %b] as: %a wrapped around %b +parse [function %names %body, def %names %body] as: action %names %body +parse [switch %branch_value %body] as: when %branch_value = ? %body +parse [None, Null] as: nil +parse [True, true] as: yes +parse [False, false] as: no +parse [pass] as: do nothing +parse [%a || %b] as: %a or %b +parse [%a && %b] as: %a and %b +parse [continue] as: do next +parse [break] as: stop +parse [let %thing = %value in %action] as: with %thing = %value %action +parse [let %assignments in %action] as: with %assignemnts %action +parse [error!, panic!, fail!, abort!] as: barf! +parse [error %, panic %, fail %, abort %] as: barf % +parse [assert %condition %message] as: assume %condition or barf %message |
