Skip to content

Commit c2a25a6

Browse files
committed
Fixed error in printTokens().
1 parent 1e26128 commit c2a25a6

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

dumbParser.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,11 @@ constantNameReplacementStringMaxLength
272272
Default: 200.
273273
274274
-- Example:
275-
local ast = parser.parse[=[
275+
local ast = parser.parse[==[
276276
local short = "a"
277277
local long = "xy"
278278
func(short, long)
279-
]=]
279+
]==]
280280
parser.constantNameReplacementStringMaxLength = 1
281281
parser.optimize(ast)
282282
print(parser.toLua(ast)) -- local long="xy";func("a",long);
@@ -4775,14 +4775,13 @@ end
47754775

47764776

47774777
function printTokens(tokens)
4778-
local printLocs = parser.printLocations
4779-
local sourcePath = tokens.sourcePath
4778+
local printLocs = parser.printLocations
47804779

47814780
for i, token in ipairs(tokens) do
47824781
local v = ensurePrintable(tostring(token.value))
47834782
if #v > 200 then v = stringSub(v, 1, 200-3).."..." end
47844783

4785-
if printLocs then ioWrite(sourcePath, ":", token.lineStart, ": ") end
4784+
if printLocs then ioWrite(token.sourcePath, ":", token.lineStart, ": ") end
47864785
ioWrite(i, ". ", F("%-11s", token.type), " '", v, "'\n")
47874786
end
47884787
end

0 commit comments

Comments
 (0)