You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -3068,7 +3074,7 @@ local function _processFileOrString(params, isFile)
3068
3074
end
3069
3075
3070
3076
locallua=table.concat(outputFromMeta)
3071
-
--[[ :PrintCode
3077
+
--[[DEBUG :PrintCode
3072
3078
print("=OUTPUT=============================")
3073
3079
print(lua)
3074
3080
print("====================================")
@@ -3095,10 +3101,15 @@ local function _processFileOrString(params, isFile)
3095
3101
localpathOut=isFileandparams.pathOutor"<output>"
3096
3102
3097
3103
ifisFilethen
3098
-
localfile=assert(io.open(pathOut, "wb"))
3099
-
file:write(specialFirstLineor"")
3100
-
file:write(lua)
3101
-
file:close()
3104
+
ifpathOut=="-" then
3105
+
io.stdout:write(specialFirstLineor"")
3106
+
io.stdout:write(lua)
3107
+
else
3108
+
localfile=assert(io.open(pathOut, "wb"))
3109
+
file:write(specialFirstLineor"")
3110
+
file:write(lua)
3111
+
file:close()
3112
+
end
3102
3113
end
3103
3114
3104
3115
-- Check if the output is valid Lua.
@@ -3218,8 +3229,8 @@ local pp = {
3218
3229
-- info: Table with various information. (See 'ProcessInfo' for more info.)
3219
3230
--
3220
3231
-- params: Table with these fields:
3221
-
-- pathIn = pathToInputFile -- [Required]
3222
-
-- pathOut = pathToOutputFile -- [Required]
3232
+
-- pathIn = pathToInputFile -- [Required] Specify "-" to use stdin.
3233
+
-- pathOut = pathToOutputFile -- [Required] Specify "-" to use stdout. (Note that if stdout is used then anything you print() in the metaprogram will end up there.)
3223
3234
-- pathMeta = pathForMetaprogram -- [Optional] You can inspect this temporary output file if an error occurs in the metaprogram.
3224
3235
--
3225
3236
-- debug = boolean -- [Optional] Debug mode. The metaprogram file is formatted more nicely and does not get deleted automatically.
0 commit comments