Skip to content

docs: clarify unsupported operators in operator precedence#9801

Open
atorrers wants to merge 1 commit intostarkware-libs:mainfrom
atorrers:docs-operator-precedence-unsupported-ops
Open

docs: clarify unsupported operators in operator precedence#9801
atorrers wants to merge 1 commit intostarkware-libs:mainfrom
atorrers:docs-operator-precedence-unsupported-ops

Conversation

@atorrers
Copy link
Copy Markdown
Contributor

@atorrers atorrers commented Mar 30, 2026

Summary

Clarify operator-precedence.adoc by documenting that chained equality (a == b == c) is unsupported and by replacing a vague assignment-table note with an explicit unsupported operator list for shift/bitwise compound assignments (<<=, >>=, &=, ^=, |=).


Type of change

Please check one:

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

⚠️ Note:
To keep maintainer workload sustainable, we generally do not accept PRs that
are only minor wording, grammar, formatting, or style changes.
Such PRs may be closed without detailed review.


Why is this change needed?

operator-precedence.adoc already documented unsupported chained comparisons (a < b < c) but did not document unsupported chained equality (a == b == c), while related operator pages already do. The assignment row also used a generic "Second line not yet supported" note instead of explicitly naming unsupported operators. This mismatch can mislead users into unsupported syntax that fails at parse/compile time.


What was the behavior or documentation before?

  • No explicit chained-equality limitation in operator-precedence.adoc.
  • Assignment table second line used a vague unsupported note without naming the actual unsupported operators.

What is the behavior or documentation after?

  • Added a Chained equality section with a concrete rewrite pattern: a == b && b == c.
  • Assignment table now explicitly states that shift/bitwise compound assignment operators (<<=, >>=, &=, ^=, |=) are not supported.

Related issue or discussion (if any)


Additional context

This is a docs-only, low-risk change that aligns this page with existing operator-reference coverage and with current parser-supported assignment operators, reducing avoidable user confusion.


Note

Low Risk
Docs-only changes that clarify unsupported Cairo syntax; no runtime or API behavior is modified.

Overview
Updates operator-precedence.adoc to explicitly document unsupported syntax. It replaces the vague assignment-table note with an explicit list of unsupported shift/bitwise compound assignments (<<=, >>=, &=, ^=, |=), and adds a new Chained equality section stating a == b == c is not supported and should be written as a == b && b == c.

Written by Cursor Bugbot for commit fed4465. This will update automatically on new commits. Configure here.

@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.

@orizi made 1 comment.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on atorrers).


docs/reference/src/components/cairo/modules/language_constructs/pages/operator-precedence.adoc line 29 at r1 (raw file):

| Assignment                            | `=` `+=` `-=` `*=` `/=` `%=`

                                          `<<=` `>>=` `&=` `^=` `\|=`    | Shift and bitwise compound assignment operators are not supported.

split into rows instead.

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