Skip to content

Add one-or-more operators#7

Merged
calico32 merged 3 commits into
mainfrom
one-or-more
Sep 16, 2025
Merged

Add one-or-more operators#7
calico32 merged 3 commits into
mainfrom
one-or-more

Conversation

@calico32

Copy link
Copy Markdown
Owner

This PR adds support for "one or more" postfix modifiers + and - via a new AST type UnaryExpr. If a token follows the - that could start a new expression, it treats the operator as infix exclusion and continues parsing as a binary expression.

parseBinaryExpr has been renamed to parseExpr as it handles both unary and binary, and the old parseExpr has been dropped.

New test matchers for unary expressions have been added as well.

Closes #6.

@calico32 calico32 merged commit eeff9c6 into main Sep 16, 2025
3 checks passed
@calico32 calico32 deleted the one-or-more branch September 16, 2025 18:16
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.

parse expressions such as '{digit}-', meaning 1 or more digits

1 participant