From 2e15c0fd5067318601e2f3b70ee6fc16ef58200d Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 27 May 2018 18:28:23 -0700 Subject: Some tweaks/cleanup on the nomsu code as well as adding variable mangling to 'parse % as %' to make almost hygienic macros. --- nomsu.peg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nomsu.peg') 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): !('[..]') -- cgit v1.2.3