Adding basic import statement support
This commit is contained in:
parent
38d2923eae
commit
249d551e5e
@ -25,7 +25,7 @@ list_literal_value
|
||||
|
||||
variable_name : IDENTIFIER;
|
||||
|
||||
statement_include_template_list
|
||||
statement_include_template
|
||||
: STRING_LITERAL
|
||||
| list_literal
|
||||
| variable_name
|
||||
@ -38,11 +38,20 @@ statement_include_context
|
||||
|
||||
statement_include
|
||||
: STATEMENT_ID_INCLUDE
|
||||
(SP statement_include_template_list)
|
||||
(SP statement_include_template)
|
||||
(SP STATEMENT_INCLUDE_IGNORE_MISSING)?
|
||||
(SP statement_include_context)?
|
||||
;
|
||||
|
||||
statement_import_file
|
||||
: STRING_LITERAL
|
||||
| variable_name
|
||||
;
|
||||
|
||||
statement_import
|
||||
: STATEMENT_ID_IMPORT SP statement_import_file SP STATEMENT_ID_IMPORT_AS SP variable_name
|
||||
;
|
||||
|
||||
block_statement_id
|
||||
: STATEMENT_ID_BLOCK
|
||||
| STATEMENT_ID_SET
|
||||
@ -64,6 +73,7 @@ block_statement_start_content
|
||||
|
||||
inline_statement_content
|
||||
: statement_include
|
||||
| statement_import
|
||||
;
|
||||
|
||||
inline_statement : STATEMENT_OPEN inline_statement_content STATEMENT_CLOSE;
|
||||
|
||||
@ -84,6 +84,8 @@ STATEMENT_ID_INCLUDE : 'include';
|
||||
STATEMENT_ID_RAW : 'raw';
|
||||
STATEMENT_ID_SET : 'set';
|
||||
|
||||
STATEMENT_ID_IMPORT_AS : 'as';
|
||||
|
||||
STATEMENT_INCLUDE_IGNORE_MISSING : 'ignore missing';
|
||||
STATEMENT_INCLUDE_WITH_CONTEXT : 'with context';
|
||||
STATEMENT_INCLUDE_WITHOUT_CONTEXT : 'without context';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user