@@ -196,7 +196,8 @@ local metaEnv = nil
196196local dummyEnv = {}
197197
198198-- Controlled by processFileOrString():
199- local current_parsingAndMeta_isDebug = false
199+ local current_parsingAndMeta_isProcessing = false
200+ local current_parsingAndMeta_isDebug = false
200201
201202-- Controlled by _processFileOrString():
202203local current_anytime_isRunningMeta = false
@@ -3642,15 +3643,21 @@ local function _processFileOrString(params, isFile)
36423643end
36433644
36443645local function processFileOrString (params , isFile )
3646+ if current_parsingAndMeta_isProcessing then
3647+ error (" Cannot process recursively." , 3 )
3648+ end
3649+
36453650 -- local startTime = os.clock() -- DEBUG
36463651 local returnValues = nil
36473652
3648- current_parsingAndMeta_isDebug = params .debug
3653+ current_parsingAndMeta_isProcessing = true
3654+ current_parsingAndMeta_isDebug = params .debug
36493655
36503656 local xpcallOk , xpcallErr = xpcall (
36513657 function ()
36523658 returnValues = pack (_processFileOrString (params , isFile ))
36533659 end ,
3660+
36543661 function (err )
36553662 if type (err ) == " string" and err :find (" \0 " , 1 , true ) then
36563663 printError (tryToFormatError (cleanError (err )))
@@ -3669,7 +3676,8 @@ local function processFileOrString(params, isFile)
36693676 end
36703677 )
36713678
3672- current_parsingAndMeta_isDebug = false
3679+ current_parsingAndMeta_isProcessing = false
3680+ current_parsingAndMeta_isDebug = false
36733681
36743682 -- Cleanup in case an error happened.
36753683 current_anytime_isRunningMeta = false
0 commit comments