diff --git a/lib/config/config_lexer.ll b/lib/config/config_lexer.ll index e0092aee3..0c75fc200 100644 --- a/lib/config/config_lexer.ll +++ b/lib/config/config_lexer.ll @@ -190,6 +190,8 @@ false { yylval->boolean = 0; return T_BOOLEAN; } const return T_CONST; var return T_VAR; this return T_THIS; +globals return T_GLOBALS; +locals return T_LOCALS; use return T_USE; apply return T_APPLY; to return T_TO; diff --git a/lib/config/config_parser.yy b/lib/config/config_parser.yy index 91eb317a4..3d053e7a6 100644 --- a/lib/config/config_parser.yy +++ b/lib/config/config_parser.yy @@ -142,6 +142,8 @@ static void MakeRBinaryOp(Expression** result, Expression *left, Expression *rig %token T_GREATER_THAN "> (T_GREATER_THAN)" %token T_VAR "var (T_VAR)" +%token T_GLOBALS "globals (T_GLOBALS)" +%token T_LOCALS "locals (T_LOCALS)" %token T_CONST "const (T_CONST)" %token T_USE "use (T_USE)" %token T_TYPE_DICTIONARY "dictionary (T_TYPE_DICTIONARY)" @@ -221,7 +223,7 @@ static void MakeRBinaryOp(Expression** result, Expression *left, Expression *rig %left UNARY_MINUS UNARY_PLUS %right '!' '~' %left '.' '(' '[' -%left T_VAR T_THIS +%left T_VAR T_THIS T_GLOBALS T_LOCALS %right ';' ',' %right T_NEWLINE %{ @@ -807,6 +809,14 @@ rterm_no_side_effect: T_STRING { $$ = new GetScopeExpression(ScopeThis); } + | T_GLOBALS + { + $$ = new GetScopeExpression(ScopeGlobal); + } + | T_LOCALS + { + $$ = new GetScopeExpression(ScopeLocal); + } | rterm_array | rterm_scope_require_side_effect {