summaryrefslogtreecommitdiff
path: root/script/parser/grammar.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/parser/grammar.lua')
-rw-r--r--script/parser/grammar.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/script/parser/grammar.lua b/script/parser/grammar.lua
index 2c046f0e..5120df20 100644
--- a/script/parser/grammar.lua
+++ b/script/parser/grammar.lua
@@ -270,10 +270,10 @@ StringClose <- ']' =eq ']'
]]
grammar 'Number' [[
-Number <- Sp ({} {'-'? NumberDef} {}) -> Number
+Number <- Sp ({} {~ '-'? NumberDef ~} {}) -> Number
NumberSuffix?
ErrNumber?
-NumberDef <- Number16 / Number10
+NumberDef <- Number16 / Integer2 / Number10
NumberSuffix<- ({} {[uU]? [lL] [lL]}) -> FFINumber
/ ({} {[iI]}) -> ImaginaryNumber
ErrNumber <- ({} {([0-9a-zA-Z] / '.')+}) -> UnknownSymbol
@@ -293,6 +293,9 @@ Float16 <- '.' X16+
/ '.' ({} {Word*}) -> MustX16
Float16Exp <- [pP] [+-]? [0-9]+
/ ({} [pP] [+-]? {}) -> MissExponent
+
+Integer2 <- ({} '0' [bB] {[01]+})
+ -> Integer2
]]
grammar 'Name' [[