From 10a19ae530530d95c2d8f30fe30600d0493659d1 Mon Sep 17 00:00:00 2001 From: bd-912 Date: Fri, 26 Apr 2024 19:40:26 -0600 Subject: HeatVisitor minor changes with retrieving from st --- heat/HeatVisitor.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'heat') 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 { 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 { 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", -- cgit v1.2.3