Allows referencing a scope not yet created.

Use the "::" syntax at the start of the symbol to force creating
a scope if it does not exists yet.

Fixes issue #479.
This commit is contained in:
Daniel Serpell 2020-12-13 20:03:17 -03:00
parent 0f8b587bc2
commit 79aff1a5b0
1 changed files with 2 additions and 2 deletions

View File

@ -136,10 +136,10 @@ SymTable* ParseScopedIdent (StrBuf* Name, StrBuf* FullName)
SB_Append (FullName, Name);
/* Search for the child scope */
Scope = SymFindScope (Scope, Name, SYM_FIND_EXISTING);
Scope = SymFindScope (Scope, Name, SYM_ALLOC_NEW);
if (Scope == 0) {
/* Scope not found */
Error ("No such scope: '%m%p'", FullName);
Error ("Can't create scope: '%m%p'", FullName);
return 0;
}