Unhelpful error message when there is junk after rule
Created by: bnoordhuis
$ echo 'macro m { rule JUNK {} => {} }' | bin/sjs -s
/home/bnoordhuis/src/sweet.js/lib/sweet.js:90
throw err$1891;
^
Error: ASSERT: Only delimiters can be exposed
at assert$1917 (/home/bnoordhuis/src/sweet.js/lib/syntax.js:17:19)
at Object.Syntax$1921.expose (/home/bnoordhuis/src/sweet.js/lib/syntax.js:83:13)
at eval (eval at <anonymous> (/home/bnoordhuis/src/sweet.js/lib/scopedEval.js:16:69), <anonymous>:80:60)
at step$623 (/home/bnoordhuis/src/sweet.js/lib/expander.js:1062:34)
at enforest$442 (/home/bnoordhuis/src/sweet.js/lib/expander.js:1183:16)
at expandToTermTree$448 (/home/bnoordhuis/src/sweet.js/lib/expander.js:1355:21)
at expandTermTreeToFinal$450 (/home/bnoordhuis/src/sweet.js/lib/expander.js:1562:38)
at /home/bnoordhuis/src/sweet.js/lib/expander.js:1615:20
at Array.map (native)
at Function._.map._.collect (/home/bnoordhuis/src/sweet.js/node_modules/underscore/underscore.js:95:56)
I was looking at how to fix that; is replacing the assert with a throwSyntaxError statement a reasonable thing to do?