Skip to content

Commit

Permalink
CL: Fixed internal error when we're supposed to report an error.
Browse files Browse the repository at this point in the history
  • Loading branch information
ReFreezed committed May 30, 2021
1 parent 237b087 commit 449f088
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.lnk
local/

/*.sublime-*
Expand Down
2 changes: 1 addition & 1 deletion preprocess-cl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ function printfError(s, ...)
end

function errorLine(err)
printError(tryToFormatError(err))
printError(pp.tryToFormatError(err))
os.exit(1)
end

Expand Down
4 changes: 2 additions & 2 deletions preprocess.lua
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ function printErrorTraceback(message, level)
tableInsertFormat(buffer, "%d:", info.currentline)
end

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

Expand Down

0 comments on commit 449f088

Please sign in to comment.