Skip to content

Commit 2c44d9b

Browse files
committed
The smallest cleanup.
1 parent 4b6ab83 commit 2c44d9b

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

dumbParser.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
--= Tokenize Lua code or create ASTs (Abstract Syntax Trees)
77
--= and convert the data back to Lua.
88
--=
9-
--= Version: 2.1 (2021-09-03)
9+
--= Version: 2.1-dev
1010
--=
1111
--= License: MIT (see the bottom of this file)
1212
--= Website: http://luaparser.refreezed.com/
@@ -422,7 +422,7 @@ Special number notation rules.
422422
423423
-============================================================]=]
424424

425-
local PARSER_VERSION = "2.1.0"
425+
local PARSER_VERSION = "2.1.0-dev"
426426

427427
local NORMALIZE_MINUS_ZERO, HANDLE_ENV
428428
do
@@ -481,7 +481,7 @@ local maybeWrapInt = (
481481
-- have to use mod again. Gah!
482482
return tonumber(n % 0x100000000) % 0x100000000 -- 0x100000000 == 2^32
483483
end)
484-
or (_VERSION == "Lua 5.2" and bit32.band)
484+
or (_VERSION == "Lua 5.2" and require"bit32".band)
485485
or function(n) return n end
486486
)
487487

@@ -567,7 +567,7 @@ local TOKEN_BYTES = {
567567
NAME_START = newCharSet"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_",
568568
DASH = newCharSet"-",
569569
NUM = newCharSet"0123456789",
570-
NUM_OR_DOT = newCharSet"0123456789.",
570+
-- NUM_OR_DOT = newCharSet"0123456789.",
571571
QUOTE = newCharSet"\"'",
572572
SQUARE = newCharSet"[",
573573
DOT = newCharSet".",
@@ -1158,7 +1158,7 @@ do
11581158
local BYTES_NAME_START = TOKEN_BYTES.NAME_START
11591159
local BYTES_DASH = TOKEN_BYTES.DASH
11601160
local BYTES_NUM = TOKEN_BYTES.NUM
1161-
local BYTES_NUM_OR_DOT = TOKEN_BYTES.NUM_OR_DOT
1161+
-- local BYTES_NUM_OR_DOT = TOKEN_BYTES.NUM_OR_DOT
11621162
local BYTES_QUOTE = TOKEN_BYTES.QUOTE
11631163
local BYTES_SQUARE = TOKEN_BYTES.SQUARE
11641164
local BYTES_DOT = TOKEN_BYTES.DOT
@@ -6449,7 +6449,7 @@ local function valueToAst(v, sortTableKeys)
64496449
local keys = {}
64506450
local indices = {}
64516451

6452-
for k, v in pairs(t) do
6452+
for k in pairs(t) do
64536453
tableInsert(keys, k)
64546454
end
64556455

test.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
local a
33
local b, c = true, "f\0o"
44

5+
local _ = 3, 345, 0xff, 0xBEBADA
6+
local _ = 3.0, 3.1416, 314.16e-2, 0.31416E1, 34e1
7+
local _ = .0, .1416, .16e-2, .31416E1, 34e1
8+
local _ = 0x0.1E, 0xA23p-4, 0X1.921FB54442D18P+1
9+
local _ = "'\'", [[\]]
10+
511
-- Comment
612
--[[ Long ]] --[==[
713
comment.

0 commit comments

Comments
 (0)