aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2016-09-14 22:58:24 +0100
committerGinger Bill <bill@gingerbill.org>2016-09-14 22:58:24 +0100
commitbd365e5176f3bc5f5e249d1a0763520e2973c2ec (patch)
tree0fe2d3f44fd478d4f5c1afc688c8d41f84be3a29 /src/parser.cpp
parent79f575ae8e7dda58a842dda3690b691e942ea86e (diff)
Fix namespacing issues for #import; allow using ImportName
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 57f5f8eff..c13fc774c 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -2539,18 +2539,19 @@ AstNode *parse_stmt(AstFile *f) {
case Token_Hash: {
s = parse_tag_stmt(f, NULL);
String tag = s->TagStmt.name.string;
- if (are_strings_equal(tag, make_string("global_scope"))) {
+ if (are_strings_equal(tag, make_string("shared_global_scope"))) {
if (f->curr_proc == NULL) {
f->is_global_scope = true;
return make_empty_stmt(f, f->cursor[0]);
}
- ast_file_err(f, token, "You cannot use #global_scope within a procedure. This must be done at the file scope.");
+ ast_file_err(f, token, "You cannot use #shared_global_scope within a procedure. This must be done at the file scope.");
return make_bad_decl(f, token, f->cursor[0]);
} else if (are_strings_equal(tag, make_string("import"))) {
// TODO(bill): better error messages
+ Token import_name;
Token file_path = expect_token(f, Token_String);
- Token as = expect_token(f, Token_as);
- Token import_name = expect_token(f, Token_Identifier);
+ expect_token(f, Token_as);
+ import_name = expect_token(f, Token_Identifier);
if (f->curr_proc == NULL) {
return make_import_decl(f, s->TagStmt.token, file_path, import_name);