diff options
author | Nicolas Williams <nico@cryptonector.com> | 2015-07-10 10:11:51 -0500 |
---|---|---|
committer | Nicolas Williams <nico@cryptonector.com> | 2015-07-10 10:19:33 -0500 |
commit | 579518c78d0a277f487a03b03c450455089e6770 (patch) | |
tree | c9782e974e8e68d51373dddbdb4c0f310c7e4cce /parser.y | |
parent | fa45a5121c2b2af03190e88bfde0a35111786ba7 (diff) |
Use `include` for import into namespace
Diffstat (limited to 'parser.y')
-rw-r--r-- | parser.y | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -60,6 +60,7 @@ struct lexer_param; %token DEF "def" %token MODULE "module" %token IMPORT "import" +%token INCLUDE "include" %token IF "if" %token THEN "then" %token ELSE "else" @@ -487,7 +488,7 @@ Import: jv_free($4); jv_free(v); } | -"import" String ';' { +"include" String ';' { jv v = block_const($2); $$ = gen_import(jv_string_value(v), gen_noop(), NULL, 0); block_free($2); @@ -505,7 +506,7 @@ Import: block_free($2); jv_free($4); } | -"import" String Exp ';' { +"include" String Exp ';' { if (!block_is_const($3)) { FAIL(@$, "Module metadata must be constant."); $$ = gen_noop(); @@ -812,6 +813,9 @@ Keyword: "import" { $$ = jv_string("import"); } | +"include" { + $$ = jv_string("include"); +} | "if" { $$ = jv_string("if"); } | |