From bd365e5176f3bc5f5e249d1a0763520e2973c2ec Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Wed, 14 Sep 2016 22:58:24 +0100 Subject: Fix namespacing issues for #import; allow using ImportName --- src/parser.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/parser.cpp') 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); -- cgit v1.2.3