Skip to content

Parser is confused by X and Y in SDEF #755

@MicahGale

Description

@MicahGale

Bug Description

Parsing error as follows

To Reproduce

problem = montepy.read_input("foo.imcnp")

Error Message

Details
  File "/Users/hartjr/miniforge/envs/moose/lib/python3.12/site-packages/montepy/mcnp_object.py", line 133, in __init__
    raise ParsingError(
montepy.errors.ParsingError:     box_test, line 34

        35| SDEF X=d1 Y=d2 Z=d3 ERG=d4 PAR=2 WGT=1
    box_test, line 35

    >   35| SDEF X=d1 Y=d2 Z=d3 ERG=d4 PAR=2 WGT=1
          |      ^ not expected here.
There was an error parsing "X".
sly: Syntax error at line 1, token=PARTICLE

    box_test, line 35

    >   35| SDEF X=d1 Y=d2 Z=d3 ERG=d4 PAR=2 WGT=1
          |           ^ not expected here.
There was an error parsing "Y".
sly: Syntax error at line 1, token=PARTICLE

    box_test, line 35

    >   35| SDEF X=d1 Y=d2 Z=d3 ERG=d4 PAR=2 WGT=1
          |                ^ not expected here.
There was an error parsing "Z".
sly: Syntax error at line 1, token=PARTICLE

MCNP input file snippet

Example


SDEF X=d1 Y=d2 Z=d3 ERG=d4 PAR=2 WGT=1

Version

  • Version 1.0.0

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

bugsA deviation from expected behavior that does not reach the level of being reportable as an "Error".parsers are hardExamples of where MCNP syntax is complicated and should be simplified.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions