From 1ec847c7222b8adb9a70264c98a44dc9911d65d3 Mon Sep 17 00:00:00 2001 From: bd-912 Date: Sun, 7 Apr 2024 12:26:47 -0600 Subject: More bugfixes in ST, changes to scoping --- st/SymbolTable.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'st/SymbolTable.java') diff --git a/st/SymbolTable.java b/st/SymbolTable.java index 9d7ffb4..7475e5e 100644 --- a/st/SymbolTable.java +++ b/st/SymbolTable.java @@ -96,22 +96,21 @@ public class SymbolTable { public TypeInstance getType(String id) { AbstractInstance symbol; return ((symbol = this.symt.get(id)) != - null && symbol.getType() != TypeEnum.classname && - symbol.getType() != TypeEnum.method) ? + null && symbol instanceof TypeInstance) ? (TypeInstance) symbol : null; } public MethodInstance getMethod(String id) { AbstractInstance symbol; return ((symbol = this.symt.get(id)) != - null && symbol.getType() == TypeEnum.method) ? + null && symbol instanceof MethodInstance) ? (MethodInstance) symbol : null; } public ClassInstance getClass(String id) { AbstractInstance symbol; return ((symbol = this.symt.get(id)) != - null && symbol.getType() == TypeEnum.classname) ? + null && symbol instanceof ClassInstance) ? (ClassInstance) symbol : null; } -- cgit v1.2.3