From c93effa313ae2d002767039c2bb8705d735fb0c3 Mon Sep 17 00:00:00 2001 From: Micah Gale Date: Fri, 9 Aug 2024 14:57:44 -0500 Subject: [PATCH 1/4] Replicated issue #476 --- tests/test_edge_cases.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_edge_cases.py b/tests/test_edge_cases.py index 2cb9d4fe..b92ee3d5 100644 --- a/tests/test_edge_cases.py +++ b/tests/test_edge_cases.py @@ -171,6 +171,14 @@ def test_material_float(self): " )", " IMP:N=1.000000 IMP:P=1.000000", ], + [ + "1 0 3 -2", + " IMP:N=1.000000 IMP:P=1.000000", + " *FILL=1 ( 0.000 0.000 0.000", + " 30.000 120.000 90.000", + " 60.000 30.000 90.000", + " 90.000 90.000 0.000)", + ], ], ) def test_complex_cell_parsing(lines): From c3472a6d169acfbc41cc99129f275cbcbe0e8e94 Mon Sep 17 00:00:00 2001 From: Micah Gale Date: Fri, 9 Aug 2024 15:37:30 -0500 Subject: [PATCH 2/4] Added more info to debug print statements. --- montepy/input_parser/parser_base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/montepy/input_parser/parser_base.py b/montepy/input_parser/parser_base.py index 75846269..25413f55 100644 --- a/montepy/input_parser/parser_base.py +++ b/montepy/input_parser/parser_base.py @@ -548,8 +548,9 @@ def _debug_parsing_error(self, token): # pragma: no cover debugfile = 'parser.out' """ - print("********* New Parsing Error ************ ") + print(f"********* New Parsing Error from: {type(self)} ************ ") print(f"Token: {token}") print(f"State: {self.state}, statestack: {self.statestack}") print(f"Symstack: {self.symstack}") + print(f"Log length: {len(self.log)}") print() From 072c944752cc7472af254b500dcb7da3c9d4d4cc Mon Sep 17 00:00:00 2001 From: Micah Gale Date: Fri, 9 Aug 2024 15:38:10 -0500 Subject: [PATCH 3/4] Added missing padding to start of anonymous fill. --- montepy/input_parser/cell_parser.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/montepy/input_parser/cell_parser.py b/montepy/input_parser/cell_parser.py index a519fe60..d1d6bf5c 100644 --- a/montepy/input_parser/cell_parser.py +++ b/montepy/input_parser/cell_parser.py @@ -181,11 +181,15 @@ def geometry_factory(self, p): # support for fill card weirdness @_( 'number_sequence "(" number_sequence ")"', + 'number_sequence "(" padding number_sequence ")"', 'number_sequence "(" number_sequence ")" padding', + 'number_sequence "(" padding number_sequence ")" padding', 'number_sequence ":" numerical_phrase', + 'number_sequence ":" padding numerical_phrase', # support for TRCL syntax '"(" number_sequence ")"', '"(" number_sequence ")" padding', + '"(" padding number_sequence ")" padding', ) def number_sequence(self, p): if isinstance(p[0], str): From 26ce6c385e459f3f911710c5b4f0e53683aae3b8 Mon Sep 17 00:00:00 2001 From: Micah Gale Date: Fri, 9 Aug 2024 15:43:13 -0500 Subject: [PATCH 4/4] Added issue #476 to changelog. --- doc/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index 5af2893e..ac7481e0 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -8,6 +8,7 @@ MontePy Changelog * Fixed bug with appending and renumbering numbered objects from other MCNP problems (:issue:`466`). * Fixed bug with dynamic typing and the parsers that only appear in edge cases (:issue:`461`). +* Fixed parser bug with having spaces in the start of the transform input for the fill of a cell (:pull:`479`). 0.3.2