diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-04-26 19:40:26 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-04-26 19:40:26 -0600 |
commit | 10a19ae530530d95c2d8f30fe30600d0493659d1 (patch) | |
tree | 19f18a55903d961e13924b99a4cd641718ce5fd5 | |
parent | e2d7b563cd22b92604e07dad9bf6bcf0393a46ca (diff) |
HeatVisitor minor changes with retrieving from st
-rw-r--r-- | heat/HeatVisitor.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/heat/HeatVisitor.java b/heat/HeatVisitor.java index 584eaec..04ba0f4 100644 --- a/heat/HeatVisitor.java +++ b/heat/HeatVisitor.java @@ -464,13 +464,15 @@ public class HeatVisitor extends GJDepthFirst<TypeBundle,String> { n.getClass().getSimpleName())); /////////////////////////////////////////////////////////////// TypeInstance t = this.symt.getType(id); + if (t == null) + t = this.symt.getTypeAttr(id); if (t == null || t.getType() != TypeEnum.intarray) throw new TypecheckException(String.format("%s called on non-array!", n.getClass().getSimpleName())); TypeBundle tb = n.f2.accept(this, argu); _ret = n.f5.accept(this, argu); - if (!tb.isInt() || _ret.isInt()) + if (!tb.isInt() || !_ret.isInt()) throw new TypecheckException(String.format("%s tried with something other than an integer!", n.getClass().getSimpleName())); /////////////////////////////////////////////////////////////// @@ -919,6 +921,8 @@ public class HeatVisitor extends GJDepthFirst<TypeBundle,String> { n.getClass().getSimpleName())); /////////////////////////////////////////////////////////////// TypeInstance t = this.symt.getType(n.f0.tokenImage); + if (t == null) + t = this.symt.getTypeAttr(n.f0.tokenImage); _ret = new TypeBundle(t.getType(), t.getClassInstance()); /////////////////////////////////////////////////////////////// MinimalLogger.info(String.format("<- %s with %s", |