From cba10851d2af7139ce98bcef478b01e3b56bf030 Mon Sep 17 00:00:00 2001 From: Lazar Bulovan Date: Thu, 19 Feb 2026 10:57:17 +0100 Subject: [PATCH] fix(parser): correctly extract type from VAR_CONSTANT with initialization The parser was incorrectly finding the ':' inside attribute blocks like {EXTERNALACCESSIBLE := 'false'} instead of the ':' after them. Added 'break' after finding the first ':' outside braces to ensure we get the correct type separator. Fixes issue where variables like: STARTING_BASEPOS : Int := 30; were showing data_type as '= 30' instead of 'Int'. --- src/parser.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/src/parser.lua b/src/parser.lua index ea436a4..936f4d5 100644 --- a/src/parser.lua +++ b/src/parser.lua @@ -96,6 +96,7 @@ function M.extract_variables(content) brace_depth = brace_depth - 1 elseif c == ":" and brace_depth == 0 then type_start = i + break -- Only take the first : outside braces end end local var_data_type = "unknown"