From e05ec065861127b9aa033b9b02aac0dcac0c7055 Mon Sep 17 00:00:00 2001 From: Joe Stanley Date: Thu, 2 May 2024 16:19:58 -0700 Subject: [PATCH] added a test, added some sample code for debugging --- blark/iec.lark | 2 +- blark/tests/source/repeated_declaration.st | 2 +- blark/tests/test_transformer.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/blark/iec.lark b/blark/iec.lark index 567883d..094c476 100644 --- a/blark/iec.lark +++ b/blark/iec.lark @@ -280,7 +280,7 @@ _type_declaration: array_type_declaration | subrange_type_declaration | enumerated_type_declaration -simple_type_declaration: simple_type_name [ extends ] ":" simple_spec_init +simple_type_declaration: simple_type_name ("," simple_type_name)* [ extends ] ":" simple_spec_init indirection_type: REFERENCE_TO | POINTER_TO+ diff --git a/blark/tests/source/repeated_declaration.st b/blark/tests/source/repeated_declaration.st index a394714..e83f295 100644 --- a/blark/tests/source/repeated_declaration.st +++ b/blark/tests/source/repeated_declaration.st @@ -1,6 +1,6 @@ METHOD doSomethingCool : BOOL VAR_INPUT - AlertTimer, SignalBadTimer, QualityBadTimer : library.TPUDO; + AlertTimer, SignalBadTimer : library.TPUDO; END_VAR // do some stuff diff --git a/blark/tests/test_transformer.py b/blark/tests/test_transformer.py index 26fe0df..babafe3 100644 --- a/blark/tests/test_transformer.py +++ b/blark/tests/test_transformer.py @@ -362,6 +362,7 @@ 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"),