Skip to content

Commit 449f088

Browse files
committed
CL: Fixed internal error when we're supposed to report an error.
1 parent 237b087 commit 449f088

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
*.lnk
12
local/
23

34
/*.sublime-*

preprocess-cl.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function printfError(s, ...)
223223
end
224224

225225
function errorLine(err)
226-
printError(tryToFormatError(err))
226+
printError(pp.tryToFormatError(err))
227227
os.exit(1)
228228
end
229229

preprocess.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ function printErrorTraceback(message, level)
282282
tableInsertFormat(buffer, "%d:", info.currentline)
283283
end
284284

285-
if info.name then
285+
if (info.name or "") ~= "" then
286286
tableInsertFormat(buffer, " in '%s'", info.name)
287287
elseif info.what == "main" then
288288
tableInsert(buffer, " in main chunk")
@@ -996,7 +996,7 @@ function serialize(buffer, v)
996996
-- Minimize \nnn sequences that aren't followed by digits.
997997
for _, i in ipairs(toMinimize) do
998998
if not (buffer[i+1] and buffer[i+1]:find"^%d") then
999-
buffer[i] = buffer[i]:gsub("0+(%d+)", "%1")
999+
buffer[i] = buffer[i]:gsub("0+(%d)", "%1")
10001000
end
10011001
end
10021002

0 commit comments

Comments
 (0)