aboutsummaryrefslogtreecommitdiff
path: root/nomsu.peg
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-05-27 18:28:23 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-05-27 18:29:23 -0700
commit2e15c0fd5067318601e2f3b70ee6fc16ef58200d (patch)
tree0006e0825b2680d457bb531c3d079661b16d6bc8 /nomsu.peg
parent6ce32bdd25694d71dc232c50a008f8824f8a75ce (diff)
Some tweaks/cleanup on the nomsu code as well as adding variable
mangling to 'parse % as %' to make almost hygienic macros.
Diffstat (limited to 'nomsu.peg')
-rw-r--r--nomsu.peg2
1 files changed, 1 insertions, 1 deletions
diff --git a/nomsu.peg b/nomsu.peg
index e5f6c56..90becb7 100644
--- a/nomsu.peg
+++ b/nomsu.peg
@@ -88,7 +88,7 @@ number (Number): (("-"? (([0-9]+ "." [0-9]+) / ("." [0-9]+) / ([0-9]+)))-> tonum
-- Variables can be nameless (i.e. just %) and can't contain operators like apostrophe
-- which is a hack to allow %'s to parse as "%" and "' s" separately
-variable (Var): "%" { ((!"'" %operator) / plain_word)* }
+variable (Var): "%" { (plain_word ((!"'" %operator) / plain_word)*)? }
inline_list (List):
!('[..]')