Skip to content

Commit

Permalink
further exploration and troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeStanleySEL committed May 6, 2024
1 parent 95c1a0d commit 0086191
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 5 additions & 1 deletion blark/iec.lark
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,11 @@ structure_type_declaration: structure_type_name_declaration [ extends ] ":" [ in
initialized_structure: structure_type_name ":=" structure_initialization

// I think we need to have var1_list used, here -- need to play around with that some more
structure_element_declaration: structure_element_name [ incomplete_location ] ":" ( initialized_structure | array_spec_init | simple_spec_init | subrange_spec_init | enumerated_spec_init | function_call )
structure_element_declaration: struct_var1_list ":" ( initialized_structure | array_spec_init | simple_spec_init | subrange_spec_init | enumerated_spec_init | function_call )

_struct_var1: structure_element_name [ incomplete_location ]

struct_var1_list: _struct_var1 ( "," _struct_var1 )*

union_element_declaration: structure_element_name ":" ( array_specification | simple_specification | indirect_simple_specification | subrange_specification | enumerated_specification )

Expand Down
12 changes: 5 additions & 7 deletions blark/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -1954,8 +1954,7 @@ class StructureElementDeclaration:
iValue1 AT %I* : INT := 5;
sValue1 : STRING[10] := 'test';
"""
name: lark.Token
location: Optional[IncompleteLocation]
variables: List[DeclaredVariable]
init: Union[
StructureInitialization,
ArrayTypeInitialization,
Expand All @@ -1968,11 +1967,6 @@ class StructureElementDeclaration:
]
meta: Optional[Meta] = meta_field()

@property
def variables(self) -> List[str]:
"""API compat: list of variable names."""
return [self.name]

@property
def value(self) -> str:
"""The initialization value, if applicable."""
Expand Down Expand Up @@ -4577,6 +4571,10 @@ def full_subrange(self):
def var1_list(self, *items: DeclaredVariable) -> List[DeclaredVariable]:
return list(items)

@_annotator_method_wrapper
def struct_var1_list(self, *items: DeclaredVariable) -> List[DeclaredVariable]:
return list(items)

@_annotator_method_wrapper
def fb_decl_name_list(self, *items: lark.Token) -> List[lark.Token]:
return list(items)
Expand Down

0 comments on commit 0086191

Please sign in to comment.