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
@@ -1300,7 +1327,19 @@ local function processFile(params)
1300
1327
metaPathForErrorMessages=""
1301
1328
outputFromMeta=nil
1302
1329
1303
-
returninfo, err
1330
+
iferrthen
1331
+
returnnil, err
1332
+
else
1333
+
returnunpack(returnValues, 1, returnValues.n)
1334
+
end
1335
+
end
1336
+
1337
+
localfunctionprocessFile(params)
1338
+
returnprocessFileOrString(params, true)
1339
+
end
1340
+
1341
+
localfunctionprocessString(params)
1342
+
returnprocessFileOrString(params, false)
1304
1343
end
1305
1344
1306
1345
@@ -1319,19 +1358,37 @@ local lib = {
1319
1358
-- error: Error message, or nil if no error happened.
1320
1359
--
1321
1360
-- params: Table with these fields:
1322
-
-- pathIn = pathToInputFile -- [Required]
1323
-
-- pathMeta = pathForMetaprogram -- [Optional] You can inspect this temporary output file if an error ocurrs in the metaprogram.
1324
-
-- pathOut = pathToOutputFile -- [Required]
1361
+
-- pathIn = pathToInputFile -- [Required]
1362
+
-- pathMeta = pathForMetaprogram -- [Optional] You can inspect this temporary output file if an error ocurrs in the metaprogram.
1363
+
-- pathOut = pathToOutputFile -- [Required]
1325
1364
--
1326
-
-- addLineNumbers = boolean -- [Optional] Add comments with line numbers to the output.
1327
-
-- debug = boolean -- [Optional] Debug mode. The metaprogram file is formatted more nicely and does not get deleted automatically.
1365
+
-- addLineNumbers = boolean -- [Optional] Add comments with line numbers to the output.
1366
+
-- debug = boolean -- [Optional] Debug mode. The metaprogram file is formatted more nicely and does not get deleted automatically.
1328
1367
--
1329
-
-- onAfterMeta = function( lua ) -- [Optional] Here you can modify and return the Lua code before it's written to 'pathOut'.
1330
-
-- onBeforeMeta = function( ) -- [Optional] Called before the metaprogram runs.
1331
-
-- onError = function( error ) -- [Optional] You can use this to get traceback information. 'error' is the same value as what is returned from processFile().
1368
+
-- onAfterMeta = function( luaCode ) -- [Optional] Here you can modify and return the Lua code before it's written to 'pathOut'.
1369
+
-- onBeforeMeta = function( ) -- [Optional] Called before the metaprogram runs.
1370
+
-- onError = function( error ) -- [Optional] You can use this to get traceback information. 'error' is the same value as what is returned from processFile().
1332
1371
--
1333
1372
processFile=processFile,
1334
1373
1374
+
-- processString()
1375
+
-- Process Lua code.
1376
+
--
1377
+
-- code, info = processString( params )
1378
+
-- info: Table with various information, or a message if an error happened. See 'ProcessInfo' for more info.
1379
+
--
1380
+
-- params: Table with these fields:
1381
+
-- code = luaCode -- [Required]
1382
+
-- pathMeta = pathForMetaprogram -- [Optional] You can inspect this temporary output file if an error ocurrs in the metaprogram.
1383
+
--
1384
+
-- addLineNumbers = boolean -- [Optional] Add comments with line numbers to the output.
1385
+
-- debug = boolean -- [Optional] Debug mode. The metaprogram file is formatted more nicely and does not get deleted automatically.
1386
+
--
1387
+
-- onBeforeMeta = function( ) -- [Optional] Called before the metaprogram runs.
1388
+
-- onError = function( error ) -- [Optional] You can use this to get traceback information. 'error' is the same value as the second returned value from processString().
0 commit comments