Closed
SweepFormula: fix parser handling of signed exponents, non-finite operands and empty arrays#2741
Conversation
3 tasks
Copilot
AI
changed the title
[WIP] Fix parser issues in SweepFormula
SweepFormula: fix parser handling of signed exponents, non-finite operands and empty arrays
Jul 14, 2026
Collaborator
|
@copilot Please fix the CI. |
Contributor
Author
Fixed in 543e4a1. The compile failure was |
… arrays SweepFormula: fix compile error by using distinct names for converted operands
t-b
force-pushed
the
copilot/fix-sweepformula-parser-issues
branch
from
July 14, 2026 14:58
6ab3cf4 to
ecd5fc0
Compare
Collaborator
|
@copilot Can you create a separate PR with the exponential changes? |
Contributor
Author
1 task
Collaborator
|
@copilot Please create a new MR against main which has only the changes for the "empty array" fix. |
1 task
Contributor
Author
Collaborator
|
THis will be done in separate PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for opening a PR in MIES ✨!
here for the detailed explanation.
Description
Three SweepFormula parser/executor defects:
1e-3gaveOperand for - must be numeric(tokenizer split at the exponent sign).1 - NaN/1 - infgaveOperand for - must be numeric(non-finite operands stored as strings).[](empty array) was rejected by the parser.Changes
MIES_SweepFormula_Parser.ipf): corrected the signed-number regex exponent order (E[+-]?[0-9]+) and added a pending-exponent regex so a+/-immediately following a number ending ine/Eis collected into the number rather than parsed as an operator.MIES_SweepFormula_Operations.ipf): text operands consisting solely of non-finite literals are converted to numeric inside the+,-,*,/operations. The recognized set (inf,-inf,NaN,-NaN, case-sensitive) mirrors the executor'sSFE_ConvertNonFiniteElementsImplso array and operation contexts stay consistent; standalone literals still return text waves.MIES_SweepFormula_Parser.ipf): explicit empty-array construction in the array action, producing[]at top level and when nested ([1,[]],[[]]). Relaxing the shared sign-evaluation assert this requires is offset by a guard that keeps invalid()reporting a clear error instead of yieldingnull.UTF_SweepFormula.ipfand documented signed exponents and non-finite operands inSweepFormula.rst.Examples