Permalink
Browse files

functions

  • Loading branch information...
1 parent a2a1112 commit f26cd67f92037f130a4a004c7d4a5c370b0afe49 @Swizec committed Apr 29, 2012
@@ -143,8 +143,24 @@ public void visit(AbsForStmt acceptor) {
@Override
public void visit(AbsFunDecl acceptor) {
- Thread.dumpStack();
- Report.error("Unimplemented visitor method.", 1);
+ SemTable.newScope();
+ try {
+ SemTable.ins(acceptor.name.name, acceptor);
+ }catch (SemIllegalInsertException e) {
+ isDeclaredError(acceptor.name.name, acceptor);
+ }
+ acceptor.pars.accept(this);
+ acceptor.type.accept(this);
+ acceptor.decls.accept(this);
+ acceptor.stmt.accept(this);
+
+ SemTable.oldScope();
+
+ try {
+ SemTable.ins(acceptor.name.name, acceptor);
+ }catch (SemIllegalInsertException e) {
+ isDeclaredError(acceptor.name.name, acceptor);
+ }
}
@Override
@@ -92,8 +92,7 @@ public void visit(AbsForStmt acceptor) {
@Override
public void visit(AbsFunDecl acceptor) {
- Thread.dumpStack();
- Report.error("Unimplemented visitor method.", 1);
+ // TODO
}
@Override
View
@@ -38,7 +38,21 @@ const
mew(m);
end;
begin
-end;
+end; { mew }
+
+function ohai3(a : boolean; b : array[1..7] of integer): boolean;
+ function o():char;
+ function ohai3():boolean;
+ begin
+ end;
+ begin
+ end; { o }
+ procedure e(a : boolean);
+ begin
+ end; { e }
+begin
+end; { ohai3 }
+
begin
end.

0 comments on commit f26cd67

Please sign in to comment.