__FILE__ is not quoted on substitution.
ayourtch opened this issue · 1 comments
ayourtch commented
Testcase:
print(__FILE__)
The file name gets substituted without the double quotes.
ayourtch commented
The following diff takes care of it:
@@ -1404,7 +1413,7 @@ function lcpp.compileFile(filename, predefines, macro_sources, next, _local)
if not file then error("file not found: "..filename) end
local code = file:read('*a')
predefines = predefines or {}
- predefines[__FILE__] = filename
+ predefines[__FILE__] = '"' .. filename .. '"'
return lcpp.compile(code, predefines, macro_sources)
end