Skip to content

parser: recognize exponentiation operators#44

Merged
Alonely0 merged 1 commit into
uutils:mainfrom
Photon101:fix/parser-exponentiation
Jun 11, 2026
Merged

parser: recognize exponentiation operators#44
Alonely0 merged 1 commit into
uutils:mainfrom
Photon101:fix/parser-exponentiation

Conversation

@Photon101

@Photon101 Photon101 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Map the lexer Circumflex token to BinaryOperator::Raise, so both ^ and ** parse as exponentiation.
  • Keep % at multiplicative precedence instead of exponentiation precedence.
  • Add parser regression coverage for exponentiation precedence, right associativity, and mixed */% expressions.

Fixes #35.

Checks

All checks were run with Rust/Cargo stable 1.96.0.

  • cargo test -p parser test_parser_exponentiation
  • cargo test -p parser test_parser_multiplicative_precedence
  • cargo test -p parser
  • cargo fmt --all -- --check
  • cargo check --workspace
  • cargo build --workspace
  • cargo test --workspace
  • cargo clippy --workspace -- -D warnings
  • cargo check --target wasm32-wasip1
  • git diff --check

@Photon101 Photon101 marked this pull request as ready for review June 11, 2026 03:56

@Alonely0 Alonely0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple and effective, tysm! We could use some more hands, so we'd appreciate you sticking around ;)

@Alonely0 Alonely0 merged commit 0bbf522 into uutils:main Jun 11, 2026
13 checks passed
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.

Parser: exponentiation operations are not recognized

2 participants