mirror of
https://github.com/notwa/lips
synced 2024-11-14 09:59:03 -08:00
add 0o and 0b prefixes for lexing octal and binary
This commit is contained in:
parent
67ce15feee
commit
7af890c3b5
1 changed files with 8 additions and 0 deletions
|
@ -147,6 +147,14 @@ function Lexer:read_number()
|
|||
self:nextc()
|
||||
self:nextc()
|
||||
return self:read_hex()
|
||||
elseif self.chr2 == 'o' then
|
||||
self:nextc()
|
||||
self:nextc()
|
||||
return self:read_octal()
|
||||
elseif self.chr2 == 'b' then
|
||||
self:nextc()
|
||||
self:nextc()
|
||||
return self:read_binary()
|
||||
elseif self.chr == '0' and self.chr2:find('%d') then
|
||||
self:nextc()
|
||||
return self:read_octal()
|
||||
|
|
Loading…
Reference in a new issue