Permalink
Browse files

Little bugs fixed =/

  • Loading branch information...
sebastorama committed Jun 12, 2012
1 parent a7fcffb commit 34550a2504fb1c6c9d4e1ad8fdb4cc412c064dbf
Showing with 6 additions and 2 deletions.
  1. +1 −0 RS.java
  2. +5 −2 SymbolTable.java
View
@@ -145,6 +145,7 @@ public void process(String n, Token t) {
if( cachedProcedure != null &&
!cachedProcedure.id.equals("read") &&
!cachedProcedure.id.equals("write") &&
+ cachedProcedure.parameters.size() > cachedParameterCount &&
cachedProcedure.parameters.get(cachedParameterCount) != expressionType) {
errors.add("Tipo incompatível de parâmetro"+
". Linha: "+t.beginLine+
View
@@ -101,8 +101,11 @@ public boolean declared(String id, int level) {
}
public Symbol search(String id, int level) {
- if(declared(id, level)) {
- return findOrCreateTable(level).get(id);
+ int i;
+ for(i = level; i>=0; i--) {
+ if(declared(id, i)) {
+ return findOrCreateTable(i).get(id);
+ }
}
return null;
}

0 comments on commit 34550a2

Please sign in to comment.