int test(char *URL) { (void)URL; /* not used */ if(scopeid()) return 6; if(append()) return 5; if(set_url()) return 1; if(set_parts()) return 2; if(get_url()) return 3; if(get_parts()) return 4; printf("success\n"); return 0; }
int SymbolTable::new_struct (ustring name) { int structid = TypeSpec::new_struct (new StructSpec (name, scopeid())); insert (new Symbol (name, TypeSpec ("",structid), SymTypeType)); return structid; }
void SymbolTable::insert (Symbol *sym) { DASSERT (sym != NULL); sym->scope (scopeid ()); m_scopetables.back()[sym->name()] = sym; m_allsyms.push_back (sym); m_allmangled[ustring(sym->mangled())] = sym; }
Symbol * SymbolTable::clash (ustring name) const { Symbol *s = find (name); return (s && s->scope() == scopeid()) ? s : NULL; }