Mercurial > projects > dang
diff sema/SymbolTableBuilder.d @ 2:ae5bbe4e7fd6
Lots of stuff, here are the git comments:
Lots of changes.
Now supports various integer-types in signed mode (byte, short, int, long)
Will cast back and forth when necessary
Doesnt check types and return type of functions is still hardcoded
Function return-types.
* Returned expressions are converted to the correct type for the function
* Callers get the correct type back
* Void functions work, and get an automatic "ret void" in the end
author | Anders Halager <halager@gmail.com> |
---|---|
date | Fri, 18 Apr 2008 02:31:07 +0200 |
parents | 2168f4cb73f1 |
children | 642c6a998fd9 |
line wrap: on
line diff
--- a/sema/SymbolTableBuilder.d Fri Apr 18 02:01:38 2008 +0200 +++ b/sema/SymbolTableBuilder.d Fri Apr 18 02:31:07 2008 +0200 @@ -41,9 +41,15 @@ { auto sym = current().add(d.identifier); sym.type = d.type; - push(); + visitExp(d.type); + visitExp(d.identifier); d.env = current(); - super.visitFuncDecl(d); + push(); + current().parentFunction = sym; + foreach (arg; d.funcArgs) + visitDecl(arg); + foreach (stmt; d.statements) + visitStmt(stmt); pop(); }