Skip to content

Handle parens in annotations properly#6

Merged
coord-e merged 2 commits into
mainfrom
parse-ambig
Sep 15, 2025
Merged

Handle parens in annotations properly#6
coord-e merged 2 commits into
mainfrom
parse-ambig

Conversation

@coord-e
Copy link
Copy Markdown
Owner

@coord-e coord-e commented Sep 15, 2025

This PR enables usage of parenthesis in logical formula annotations

@coord-e coord-e requested a review from Copilot September 15, 2025 04:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables proper handling of parentheses in logical formula annotations by restructuring the parser to support both formulas and terms in a unified parsing approach.

  • Introduces a unified FormulaOrTerm enum that can represent either formulas or terms with ambiguous binary operations
  • Refactors the parser to use operator precedence parsing with separate precedence levels for different operators
  • Adds support for parentheses in logical expressions by allowing formulas and terms to be parsed within parenthetical expressions

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tests/ui/pass/annot.rs Adds test case demonstrating parentheses usage in logical formula annotations
tests/ui/fail/annot.rs Adds test case showing invalid formula that should fail verification
src/annot.rs Major parser refactoring to support unified formula/term parsing with proper precedence handling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread tests/ui/fail/annot.rs
Comment thread src/annot.rs
Comment thread src/annot.rs
@coord-e coord-e merged commit 855ff0a into main Sep 15, 2025
3 checks passed
@coord-e coord-e deleted the parse-ambig branch September 15, 2025 04:47
coeff-aij pushed a commit to coeff-aij/thrust that referenced this pull request Jan 12, 2026
Handle parens in annotations properly
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.

2 participants