Mercurial > projects > dil
diff trunk/src/dil/SymbolTable.d @ 562:b0533550d64c
Added semantic() to VariableDeclaration.
Renamed member type to typeNode in VariableDeclaration.
Added insert() and error() to class Scope.
Made class SymbolTable a struct.
Added insert() and lookup() to ScopeSymbol.
Added insert() to Aggregate.
Added semantic() to TypeNode.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Fri, 28 Dec 2007 17:48:47 +0100 |
parents | 19554e79e6d2 |
children | 3c867a683258 |
line wrap: on
line diff
--- a/trunk/src/dil/SymbolTable.d Wed Dec 26 23:38:16 2007 +0100 +++ b/trunk/src/dil/SymbolTable.d Fri Dec 28 17:48:47 2007 +0100 @@ -11,7 +11,7 @@ /++ Maps an identifier string to a Symbol. +/ -class SymbolTable +struct SymbolTable { protected Symbol[char[]] table; @@ -22,4 +22,9 @@ auto psym = ident.str in table; return psym ? *psym : null; } + + void insert(Symbol s, Identifier* ident) + { + table[ident.str] = s; + } }