Mercurial > projects > dil
comparison trunk/src/dil/semantic/Scope.d @ 683:1ae72234db26
Implemented some methods in SemanticPass1.
Renamed Symbol.ident to name.
Added a constructor to Symbol.
Adapted constructors of classes that inherit from Symbol.
Added Alias and OverloadSet Symbol classes.
Renamed idents and values to names and inits in VariablesDeclaration.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Mon, 21 Jan 2008 17:10:12 +0100 |
parents | e7811328e6c7 |
children | d33895f679eb |
comparison
equal
deleted
inserted
replaced
682:7541c64fc423 | 683:1ae72234db26 |
---|---|
48 } | 48 } |
49 | 49 |
50 /// Insert a new variable symbol into this scope. | 50 /// Insert a new variable symbol into this scope. |
51 void insert(Variable var) | 51 void insert(Variable var) |
52 { | 52 { |
53 auto sym = symbol.lookup(var.ident); | 53 auto sym = symbol.lookup(var.name); |
54 if (sym) | 54 if (sym) |
55 { | 55 { |
56 auto loc = sym.node.begin.getErrorLocation(); | 56 auto loc = sym.node.begin.getErrorLocation(); |
57 auto locString = Format("{}({},{})", loc.filePath, loc.lineNum, loc.colNum); | 57 auto locString = Format("{}({},{})", loc.filePath, loc.lineNum, loc.colNum); |
58 error(var.node.begin, MSG.VariableConflictsWithDecl, var.ident.str, locString); | 58 error(var.node.begin, MSG.VariableConflictsWithDecl, var.name.str, locString); |
59 } | 59 } |
60 else | 60 else |
61 symbol.insert(var, var.ident); | 61 symbol.insert(var, var.name); |
62 // Set the current scope symbol as the parent. | 62 // Set the current scope symbol as the parent. |
63 var.parent = symbol; | 63 var.parent = symbol; |
64 } | 64 } |
65 | 65 |
66 /++ | 66 /++ |