Skip to content

Commit 2d79215

Browse files
committed
Slightly modified debug output formatting.
1 parent e6e5c19 commit 2d79215

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

preprocess.lua

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,18 +1397,34 @@ local function _processFileOrString(params, isFile)
13971397
end
13981398

13991399
-- Output.
1400-
table.insert(metaParts, '__LUA"')
1400+
if isDebug then
1401+
table.insert(metaParts, '__LUA("')
14011402

1402-
if params.addLineNumbers then
1403-
outputLineNumber(metaParts, tokens[metaLineIndexStart].line)
1404-
end
1403+
if params.addLineNumbers then
1404+
outputLineNumber(metaParts, tokens[metaLineIndexStart].line)
1405+
end
1406+
1407+
if isLocal then table.insert(metaParts, 'local ') end
1408+
1409+
table.insert(metaParts, ident)
1410+
table.insert(metaParts, ' = "); __VAL(')
1411+
table.insert(metaParts, ident)
1412+
table.insert(metaParts, '); __LUA("\\n")\n')
14051413

1406-
if isLocal then table.insert(metaParts, 'local ') end
1414+
else
1415+
table.insert(metaParts, '__LUA"')
1416+
1417+
if params.addLineNumbers then
1418+
outputLineNumber(metaParts, tokens[metaLineIndexStart].line)
1419+
end
14071420

1408-
table.insert(metaParts, ident)
1409-
table.insert(metaParts, ' = "__VAL(')
1410-
table.insert(metaParts, ident)
1411-
table.insert(metaParts, ')__LUA"\\n"\n')
1421+
if isLocal then table.insert(metaParts, 'local ') end
1422+
1423+
table.insert(metaParts, ident)
1424+
table.insert(metaParts, ' = "__VAL(')
1425+
table.insert(metaParts, ident)
1426+
table.insert(metaParts, ')__LUA"\\n"\n')
1427+
end
14121428

14131429
flushTokensToProcess()
14141430
end

0 commit comments

Comments
 (0)