aboutsummaryrefslogtreecommitdiff
path: root/nomsu.4.peg
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-11-11 15:25:25 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-11-11 15:26:30 -0800
commit5f38d73004f0fcf259acfa12d46feff4c6170273 (patch)
tree28bcef232efeded6c2cdff15ab6542e056d23515 /nomsu.4.peg
parent9a75d25c843b03e3671b71384fd48deb0607db43 (diff)
Now preserving hex numbers with "0xF00" -> parse -> decompile ->
"0xF00", fix for (compile error at ...)
Diffstat (limited to 'nomsu.4.peg')
-rw-r--r--nomsu.4.peg4
1 files changed, 3 insertions, 1 deletions
diff --git a/nomsu.4.peg b/nomsu.4.peg
index e7fc09a..b2e636f 100644
--- a/nomsu.4.peg
+++ b/nomsu.4.peg
@@ -173,7 +173,9 @@ indented_plain_text (Text):
text_interpolation:
inline_text_interpolation / ("\" indented_expression (blank_lines =curr_indent "..")?)
-number (Number): (("-"? (([0-9]+ "." [0-9]+) / ("." [0-9]+) / "0x" [0-9a-fA-F]+ / ([0-9]+)))-> tonumber)
+number (Number):
+ (&("-"? "0x" [0-9a-fA-F]+) {:hex: '' -> 'yes' :})?
+ (("-"? (([0-9]+ "." [0-9]+) / ("." [0-9]+) / "0x" [0-9a-fA-F]+ / ([0-9]+)))-> tonumber)
-- Variables can be nameless (i.e. just %) and can only contain identifier chars.
-- This ensures you don't get weird parsings of `%x+%y` or `%'s thing`.