numbers can start with .

This commit is contained in:
leaf corcoran 2013-01-24 15:20:06 -08:00
parent e0a6d4f44d
commit f75ebb80a6
3 changed files with 11 additions and 1 deletions

View File

@ -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)

View File

@ -11,6 +11,10 @@
0xabcdef
0xABCDEF
.2323
.2323e-1
.2323e13434
[[ hello world ]]
[=[ hello world ]=]

View File

@ -7,6 +7,9 @@ _ = 0x12323
_ = 0xfF2323
_ = 0xabcdef
_ = 0xABCDEF
_ = .2323
_ = .2323e-1
_ = .2323e13434
_ = [[ hello world ]]
_ = [=[ hello world ]=]
_ = [====[ hello world ]====]