Skip to content

docs: clarify mixed comparison/equality in operator precedence#9864

Merged
orizi merged 1 commit intostarkware-libs:mainfrom
Elena343-ai:docs-mixed-comparison-equality-precedence
Apr 22, 2026
Merged

docs: clarify mixed comparison/equality in operator precedence#9864
orizi merged 1 commit intostarkware-libs:mainfrom
Elena343-ai:docs-mixed-comparison-equality-precedence

Conversation

@Elena343-ai
Copy link
Copy Markdown
Contributor

Summary

Document that mixed consecutive comparison/equality operators such as a < b == c and a == b < c are also unsupported in the operator precedence reference, and point readers to explicit conjunctions or parenthesized boolean comparisons instead.


Type of change

  • Bug fix (fixes incorrect behavior)
  • New feature
  • Performance improvement
  • Documentation change with concrete technical impact
  • Style, wording, formatting, or typo-only change

Why is this change needed?

The operator precedence page currently groups comparison and equality operators in the same precedence row and explains left-to-right associativity, but it only documents unsupported homogeneous chains such as a < b < c and a == b == c. That leaves a real ambiguity for mixed forms like a < b == c and a == b < c, which users can reasonably expect to parse from the precedence table alone. The parser rejects these forms with E1028.


What was the behavior or documentation before?

The page did not state that mixed consecutive comparison/equality operators are rejected.


What is the behavior or documentation after?

The page explicitly documents that mixed forms such as a < b == c and a == b < c are unsupported and points to explicit conjunctions or parenthesized boolean comparisons instead.


Related issue or discussion (if any)

N/A


Additional context

This matches the parser behavior for consecutive comparison/equality operators and follows the recent docs: clarify ... operator-documentation pattern already merged in this repository.

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

Copy link
Copy Markdown
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

:lgtm:

@orizi reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Elena343-ai).

@orizi orizi enabled auto-merge April 22, 2026 20:11
@orizi orizi added this pull request to the merge queue Apr 22, 2026
Merged via the queue into starkware-libs:main with commit 0919a04 Apr 22, 2026
53 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.

3 participants