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'.
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user