@@ -66,28 +66,14 @@ def ParseSTFile(self, file):
6666 f"Error: { STRUCT_TOKEN } found out of { TYPE_TOKEN } block declaration."
6767 )
6868 name = f"{ line .split (':' )[0 ].strip ()} "
69- complex_vars .append ((name , {} ))
69+ complex_vars .append ((name , [] ))
7070 parsing = True
7171 continue
7272 elif f"END_{ STRUCT_TOKEN } " in line :
7373 parsing = False
7474 continue
7575 elif parsing :
76- splitted_line = line .replace (":=" , ":" ).split (":" )
77- if len (splitted_line ) == 3 :
78- # Handle complex variable with type and initial value
79- name , type , value = (
80- splitted_line [0 ].strip (),
81- splitted_line [1 ].strip (),
82- splitted_line [2 ].replace (";" , "" ).strip (),
83- )
84- complex_vars [- 1 ][1 ][name ] = {"type" : type , "value" : value }
85- continue
86- name , type = (
87- splitted_line [0 ].strip (),
88- splitted_line [1 ].replace (";" , "" ).strip (),
89- )
90- complex_vars [- 1 ][1 ][name ] = {"type" : type , "value" : None }
76+ complex_vars [- 1 ][1 ].append (line )
9177 continue
9278 # Remove type block if empty
9379 elif f"END_{ TYPE_TOKEN } " in line :
@@ -96,7 +82,7 @@ def ParseSTFile(self, file):
9682 new_lines .pop ()
9783 continue
9884 # Skip consecutive empty lines
99- elif not l . strip () and not (new_lines and new_lines [- 1 ].strip ()):
85+ elif not line and not (new_lines and new_lines [- 1 ].strip ()):
10086 continue
10187
10288 new_lines .append (l )
0 commit comments