mirror of
https://github.com/leafo/moonscript.git
synced 2024-11-22 02:44:23 +00:00
numbers can start with .
This commit is contained in:
parent
e0a6d4f44d
commit
f75ebb80a6
@ -52,7 +52,10 @@ local _Name = C(R("az", "AZ", "__") * AlphaNum^0)
|
||||
local Name = Space * _Name
|
||||
|
||||
local Num = P"0x" * R("09", "af", "AF")^1 +
|
||||
R"09"^1 * (P"." * R"09"^1)^-1 * (S"eE" * P"-"^-1 * R"09"^1)^-1
|
||||
(
|
||||
R"09"^1 * (P"." * R"09"^1)^-1 +
|
||||
P"." * R"09"^1
|
||||
) * (S"eE" * P"-"^-1 * R"09"^1)^-1
|
||||
|
||||
Num = Space * (Num / function(value) return {"number", value} end)
|
||||
|
||||
|
@ -11,6 +11,10 @@
|
||||
0xabcdef
|
||||
0xABCDEF
|
||||
|
||||
.2323
|
||||
.2323e-1
|
||||
.2323e13434
|
||||
|
||||
[[ hello world ]]
|
||||
|
||||
[=[ hello world ]=]
|
||||
|
@ -7,6 +7,9 @@ _ = 0x12323
|
||||
_ = 0xfF2323
|
||||
_ = 0xabcdef
|
||||
_ = 0xABCDEF
|
||||
_ = .2323
|
||||
_ = .2323e-1
|
||||
_ = .2323e13434
|
||||
_ = [[ hello world ]]
|
||||
_ = [=[ hello world ]=]
|
||||
_ = [====[ hello world ]====]
|
||||
|
Loading…
Reference in New Issue
Block a user