Renaming @builtin into @global for better clarity

This commit is contained in:
Pavel Shevaev 2023-05-26 12:04:07 +03:00
parent e5507303cd
commit 5681e61fdf
1 changed files with 12 additions and 17 deletions

View File

@ -749,7 +749,7 @@ class JSM_MacroPHPNode implements JSM_MacroNode
var $refl; var $refl;
var $user_args = ''; var $user_args = '';
var $is_builtin; var $is_global;
var $is_eval_args; //arguments will be evaluated and eval result will be passed var $is_eval_args; //arguments will be evaluated and eval result will be passed
var $is_raw_args; //arguments result string will be passed, not evaluated var $is_raw_args; //arguments result string will be passed, not evaluated
var $is_node_args; //argument nodes will be passed as is var $is_node_args; //argument nodes will be passed as is
@ -764,7 +764,7 @@ class JSM_MacroPHPNode implements JSM_MacroNode
$this->refl = new ReflectionFunction($php_func); $this->refl = new ReflectionFunction($php_func);
$doc = $this->refl->getDocComment(); $doc = $this->refl->getDocComment();
$this->is_builtin = strpos($doc, '@builtin') !== false; $this->is_global = strpos($doc, '@global') !== false;
$this->is_raw_args = strpos($doc, '@raw_args') !== false; $this->is_raw_args = strpos($doc, '@raw_args') !== false;
$this->is_eval_args = strpos($doc, '@eval_args') !== false; $this->is_eval_args = strpos($doc, '@eval_args') !== false;
$this->is_no_args = strpos($doc, '@no_args') !== false; $this->is_no_args = strpos($doc, '@no_args') !== false;
@ -785,7 +785,8 @@ class JSM_MacroPHPNode implements JSM_MacroNode
function call(JSM $jsm) function call(JSM $jsm)
{ {
//NOTE: making sure file containing PHP macro was actually included by this file //NOTE: making sure file containing PHP macro was actually included by this file
if(!$this->is_builtin && !$jsm->_isIncluded($this->refl->getFileName())) // if it's not a @global one
if(!$this->is_global && !$jsm->_isIncluded($this->refl->getFileName()))
throw new Exception("Macro source file was not included by config file itself: ".$this->refl->getFileName()); throw new Exception("Macro source file was not included by config file itself: ".$this->refl->getFileName());
$named = false; $named = false;
@ -1791,13 +1792,7 @@ class JSM_ArgsParser
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
/** /**
* @builtin @raw_args * @global @raw_args
*/
function macro_DEP($jsm)
{}
/**
* @builtin @raw_args
*/ */
function macro_INC($jsm, $file) function macro_INC($jsm, $file)
{ {
@ -1806,7 +1801,7 @@ function macro_INC($jsm, $file)
} }
/** /**
* @builtin @raw_args * @global @raw_args
*/ */
function macro_LET($jsm, $txt_args) function macro_LET($jsm, $txt_args)
{ {
@ -1816,7 +1811,7 @@ function macro_LET($jsm, $txt_args)
} }
/** /**
* @builtin @raw_args * @global @raw_args
*/ */
function macro_VAL($jsm, $txt_args) function macro_VAL($jsm, $txt_args)
{ {
@ -1837,7 +1832,7 @@ function macro_VAL($jsm, $txt_args)
//simple version of variable echoing //simple version of variable echoing
/** /**
* @builtin @raw_args * @global @raw_args
*/ */
function macro_SVAL($jsm, $txt_args) function macro_SVAL($jsm, $txt_args)
{ {
@ -1845,7 +1840,7 @@ function macro_SVAL($jsm, $txt_args)
} }
/** /**
* @builtin * @global
*/ */
function macro_CONST($jsm, $k, $v) function macro_CONST($jsm, $k, $v)
{ {
@ -2038,7 +2033,7 @@ function macro_ex_ENDREP(JSM $jsm)
} }
/** /**
* @builtin @raw_args * @global @raw_args
*/ */
function macro_CALL($proc, $raw_args) function macro_CALL($proc, $raw_args)
{ {
@ -2050,7 +2045,7 @@ function macro_CALL($proc, $raw_args)
} }
/** /**
* @builtin @eval_args * @global @eval_args
*/ */
function macro_TRACE($jsm, array $eval_res) function macro_TRACE($jsm, array $eval_res)
{ {
@ -2058,7 +2053,7 @@ function macro_TRACE($jsm, array $eval_res)
} }
/** /**
* @builtin @raw_args * @global @raw_args
*/ */
function macro_LET_IF($jsm, $raw_args) function macro_LET_IF($jsm, $raw_args)
{ {