From 3c510e4ee5027aa5191e994bdf0a080a32a4b082 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 12 Jun 2018 18:04:18 -0700 Subject: Lots of optimizations and simplifications, especially towards getting better performance on luajit. --- nomsu.peg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nomsu.peg') diff --git a/nomsu.peg b/nomsu.peg index 2de5292..2654f21 100644 --- a/nomsu.peg +++ b/nomsu.peg @@ -98,11 +98,11 @@ text_interpolation: inline_text_interpolation / ("\" indented_expression nodent "..") -number (Number): {| {:value: (("-"? (([0-9]+ "." [0-9]+) / ("." [0-9]+) / ([0-9]+)))-> tonumber) :} |} +number (Number): {| (("-"? (([0-9]+ "." [0-9]+) / ("." [0-9]+) / ([0-9]+)))-> tonumber) |} -- 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): "%" {| {:value: (%ident_char+ ((!"'" %operator_char+) / %ident_char+)*)? :} |} +variable (Var): "%" {| {(%ident_char+ ((!"'" %operator_char+) / %ident_char+)*)?} |} inline_list (List): !('[..]') -- cgit v1.2.3