Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix monadic token priority to resolve issue #31 #34

Merged
merged 2 commits into from
Jun 12, 2024

Conversation

fluidnumerics-joe
Copy link
Member

@fluidnumerics-joe fluidnumerics-joe commented Jun 12, 2024

The priority function, which is used in infix to postfix conversion, has been updated to separate out function, operator, and monad token types and assign priority for order of operations within each class. Functions and monads take highest priority; Monads ( negative signs in front of numbers, variables, and parentheses) need highest priority so that the sign flip is applied immediately after a number or variable is pushed on to the evaluation stack.

A new test is added, based on the MWE from @angelog0 in issue #31 to ensure this issue remains covered in tests

Resolves #31

@codecov-commenter
Copy link

codecov-commenter commented Jun 12, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Files Patch % Lines
src/FEQParse.F90 91.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Intel ifort compiler builds fail on parsing_* tests; errors suggest
priority value was unset. This patch preserves previous behavior for
operators in addition to increasing monad priority
@fluidnumerics-joe fluidnumerics-joe merged commit 2162a72 into master Jun 12, 2024
18 checks passed
@fluidnumerics-joe fluidnumerics-joe deleted the bugfix/monad-parse-error branch June 12, 2024 20:10
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.

Wrong sign parsing a function
2 participants