From 4d375816942df36796fdc8b60060bccb30a1a846 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Thu, 11 Apr 2024 00:51:08 +0200 Subject: [PATCH] fix the symbol lookup error lsb(a) when a is in a multi vardecl. --- compilerAst/src/prog8/ast/AstToplevel.kt | 9 ++------- docs/source/todo.rst | 2 -- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/compilerAst/src/prog8/ast/AstToplevel.kt b/compilerAst/src/prog8/ast/AstToplevel.kt index 8121110cc..94d849786 100644 --- a/compilerAst/src/prog8/ast/AstToplevel.kt +++ b/compilerAst/src/prog8/ast/AstToplevel.kt @@ -82,13 +82,8 @@ interface IStatementContainer { // but adding a memoization cache didn't make much of a practical runtime difference... for (stmt in statements) { when(stmt) { -// is INamedStatement -> { -// if(stmt.name==name) return stmt -// } - is VarDecl -> if(stmt.name==name) return stmt - is Label -> if(stmt.name==name) return stmt - is Subroutine -> if(stmt.name==name) return stmt - is Block -> if(stmt.name==name) return stmt + is VarDecl -> if(stmt.name==name || stmt.names.contains(name)) return stmt + is INamedStatement -> if(stmt.name==name) return stmt is AnonymousScope -> { val found = stmt.searchSymbol(name) if(found!=null) diff --git a/docs/source/todo.rst b/docs/source/todo.rst index b6b89d0eb..0c203eb06 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -1,8 +1,6 @@ TODO ==== -fix the symbol lookup error lsb(a) when a is in a multi vardecl. - ...