From e35f2280caa864b2f1a3c6bdf539eeea20e54f06 Mon Sep 17 00:00:00 2001 From: Joe Stanley Date: Fri, 3 May 2024 11:16:46 -0700 Subject: [PATCH] revision --- blark/iec.lark | 2 +- blark/tests/source/repeated_declaration.st | 12 +++++------- blark/tests/test_transformer.py | 1 - 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/blark/iec.lark b/blark/iec.lark index 567883d..d06fcf4 100644 --- a/blark/iec.lark +++ b/blark/iec.lark @@ -349,7 +349,7 @@ structure_type_declaration: structure_type_name_declaration [ extends ] ":" [ in initialized_structure: structure_type_name ":=" structure_initialization -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: var1_list ":" ( initialized_structure | array_spec_init | simple_spec_init | subrange_spec_init | enumerated_spec_init | function_call ) union_element_declaration: structure_element_name ":" ( array_specification | simple_specification | indirect_simple_specification | subrange_specification | enumerated_specification ) diff --git a/blark/tests/source/repeated_declaration.st b/blark/tests/source/repeated_declaration.st index e83f295..4981b61 100644 --- a/blark/tests/source/repeated_declaration.st +++ b/blark/tests/source/repeated_declaration.st @@ -1,7 +1,5 @@ -METHOD doSomethingCool : BOOL -VAR_INPUT - AlertTimer, SignalBadTimer : library.TPUDO; -END_VAR - -// do some stuff -END_METHOD +TYPE someStruct : +STRUCT + AlertTimer, SignalBadTimer, QualityBadTimer : library.TPUDO; +END_STRUCT +END_TYPE diff --git a/blark/tests/test_transformer.py b/blark/tests/test_transformer.py index babafe3..26fe0df 100644 --- a/blark/tests/test_transformer.py +++ b/blark/tests/test_transformer.py @@ -362,7 +362,6 @@ def test_bool_literal_roundtrip(name, value, expected): param("expression", "_directoryFileList.Item(_i).ToString()"), param("expression", "_directoryFileList.Item(_i)^.ToString()"), param("simple_type_declaration", "TypeName : INT"), - param("simple_type_declaration", "TypeName, TypeName2 : INT"), param("simple_type_declaration", "TypeName : INT := 5"), param("simple_type_declaration", "TypeName : INT := 5 + 1 * (2)"), param("simple_type_declaration", "TypeName : REFERENCE TO INT"),