Skip to content

Feature/spaces#21

Open
whaeck wants to merge 15 commits intodevelopfrom
feature/spaces
Open

Feature/spaces#21
whaeck wants to merge 15 commits intodevelopfrom
feature/spaces

Conversation

@whaeck
Copy link
Copy Markdown
Member

@whaeck whaeck commented Sep 26, 2022

This PR is to allow for cases where spaces are used instead of '0' in the exponent. This change is made in response to some ENDF files (e.g. the IRDFF-II files) still using constructs like '1.2345E+ 1' as values (these appear to be remnants from older fortran standards).

These changes clean up some code and add the possibility of reading the following special cases:

  • white space characters in the exponent like '1.2345E+ 1'
  • trailing white space characters after the fraction and before the exponent like '0.0 E+0' or '0. +0'
  • combination of the two previous possibilities like ' 0.0 E 0' or ' 0. + 0'

As per the current standard procedures, this will go into develop first.

These changes were tested on the entire ENDF/B-VIII.0 library (using the develop version of ENDFtk) to ensure no regression. Some additional changes were made following these tests.

CHECK_THROWS( parse( "E+a123", position ) );
CHECK_THROWS( parse( "D-a123", position ) );
CHECK_THROWS( parse( "D+a123", position ) );
CHECK_THROWS( parse( "E -123", position ) );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are valid in Fortran :)

CHECK_THROWS( parse( "D +123", position ) );

CHECK_THROWS( parse( "- a3", position ) );
CHECK_THROWS( parse( "- ", position ) );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fortunately, this one is not valid. I did confirm that because I was concerned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants