Skip to content

Conversation

@jacobpake
Copy link

@jacobpake jacobpake commented Nov 24, 2025

Parsers created with buildExprParser will try to chain prefix and postfix operators.

Previously, it was not possible to chain prefix operators, e.g. not not True, though this is was the behaviour for infix operators.

Consumers of this library may rely on the old behaviour.

Currently, this PR is a breaking change.

It should be considered if chaining/non-chaining is configurable on a per-operator basis (similar to how associativity is configurable for infix operators).

Another option is to add new constructor(s) to Operator, e.g. PrefixChained, PostfixChained to avoid the breaking change.

Resolves #241


Checklist:

  • Added the change to the changelog's "Unreleased" section with a link to this PR and your username
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation in the README and/or documentation directory
  • Added a test for the contribution (if applicable)

@jacobpake jacobpake marked this pull request as draft November 24, 2025 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Chaining of prefix and postfix operators

1 participant