Skip to content

expression-parsing: add notation_warnings and NotationWarning - #8

Merged
m-messer merged 1 commit into
mainfrom
feat/notation-warnings
Oct 16, 2026
Merged

m-messer merged 1 commit into
mainfrom
feat/notation-warnings

Conversation

@m-messer

Copy link
Copy Markdown
Member

Moves notation-warning detection out of compareExpressions' evaluation.py into lambdafeedback.expression_parsing. Independent of the criteria stack.

Changes

  • notation_warnings(response, strict_syntax) in the new notation.py returns the NotationWarnings for a response:
    • EXPONENT (^) and FACTORIAL (!) under strict syntax;
    • TRIPLE_FACTORIAL (!!!) always.
  • NotationWarning is a StrEnum whose values are compareExpressions' feedback tags (NOTATION_WARNING_EXPONENT, ...), so a tag lookup keeps working. Wording the warnings stays with the caller.
  • Same behaviour as before: the checks are substring tests, so under strict syntax != also warns FACTORIAL, and !!! warns both FACTORIAL and TRIPLE_FACTORIAL. Documented in the docstring and CHANGELOG.

Downstream
Additive. compareExpressions can call this and keep its existing tag-keyed feedback text.

Verification

  • ruff, format and mypy are clean, and all four test suites pass.
  • New tests cover each warning in strict and natural mode, the != and !!! cases, and that the enum values match the compareExpressions tags.

🤖 Generated with Claude Code

… detecting misuse of symbols (e.g., `^`, `!`, `!!!`) under strict syntax, update tests, and changelog
@m-messer
m-messer merged commit 9554277 into main Oct 16, 2026
8 checks passed
@m-messer
m-messer deleted the feat/notation-warnings branch October 16, 2026 10:18
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.

1 participant