GeezerVison is showing github.com — feat(parser): add boolean shorthand expressions by Seddryck · Pull Request #83 · Seddryck/Expressif.Syntax
Conversation
Seddryck
commented
Aug 18, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
- parse
! as lossless shorthand syntax for the existing not function
- parse
|AND, |OR, and |XOR as left-associative shorthand syntax for the existing boolean functions
- support grouping with the existing parenthesized-expression syntax
- expose typed unary, binary, and operator syntax nodes without semantic lowering
- add valid, composed, grouped, whitespace, and malformed-input coverage
Validation
npm exec tree-sitter test -- --file-name boolean-shorthands.txt (18/18 passed)
dotnet test bindings/csharp/Expressif.Syntax.Tests/Expressif.Syntax.Tests.csproj --no-restore --nologo -f net8.0 -p:NuGetAudit=false -p:TargetFrameworks=net8.0 (146/146 passed)
Closes #38
Closes #39
Closes #40
Summary by CodeRabbit
-
New Features
- Added unary shorthand expressions using the
! operator.
- Added binary shorthand expressions using
|AND, |OR, and |XOR.
- Supports nesting, precedence, associativity, parentheses, pipelines, function arguments, and generic operands.
-
Bug Fixes
- Improved parsing and error recovery for incomplete, malformed, or unsupported shorthand expressions.
- Updated parameterized-expression error reporting for missing separators.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Aug 18, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 02ef9317-2bfd-4c38-91b3-ad86517c376a
📥 Commits
Reviewing files that changed from the base of the PR and between a6484e1 and 0752f73.
📒 Files selected for processing (9)
bindings/csharp/Expressif.Syntax.Tests/SyntaxBindingTests.cs
bindings/csharp/Expressif.Syntax/ExpressifSyntax.cs
bindings/csharp/Expressif.Syntax/SyntaxNodes.cs
grammar.js
src/grammar.json
src/node-types.json
src/parser.c
test/corpus/boolean-shorthands.txt
test/corpus/parameterized_expressions.txt
Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review.
📝 Walkthrough
Walkthrough
The grammar now parses unary and binary shorthand expressions with precedence and composition rules. Tree-sitter node definitions and C# syntax bindings expose their operators and operands. Corpus and binding tests cover valid, nested, composed, and malformed expressions.
Changes
Boolean shorthand expressions
| Layer / File(s) |
Summary |
Expression grammar and node model grammar.js, src/grammar.json, src/node-types.json |
Adds !, ` |
C# syntax binding bindings/csharp/Expressif.Syntax/SyntaxNodes.cs, bindings/csharp/Expressif.Syntax/ExpressifSyntax.cs |
Adds unary and binary syntax kinds and node classes. Binds operators and recursive operands from Tree-sitter expression nodes. |
Parsing and binding validation test/corpus/boolean-shorthands.txt, bindings/csharp/Expressif.Syntax.Tests/SyntaxBindingTests.cs, test/corpus/parameterized_expressions.txt |
Adds coverage for expression structure, precedence, associativity, composition, spans, child ordering, malformed input, and parser recovery. |
Estimated code review effort: 4 (Complex) | ~45 minutes
Merge Risk: ⚪ Minimal · up to 0752f
The PR adds boolean shorthand parsing and typed syntax nodes with passing parser and C# test validation; no actionable merge-blocking risk remains beyond normal checks and review.
Sequence Diagram(s)
sequenceDiagram
participant Source
participant TreeSitterParser
participant ExpressifSyntax
participant SyntaxBindingTests
Source->>TreeSitterParser: parse unary or binary shorthand
TreeSitterParser->>ExpressifSyntax: provide expression CST nodes
ExpressifSyntax->>SyntaxBindingTests: expose bound operators and operands
SyntaxBindingTests->>SyntaxBindingTests: verify structure and malformed-input recovery
Loading
Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (2 warnings)
| Check name |
Status |
Explanation |
Resolution |
| Linked Issues check |
⚠️ Warning |
Issues [#38] and [#39] are addressed, but [#40] requires a dedicated curly-brace grouping node that the changes do not add or test. |
Add explicit grouped-expression CST nodes for curly-brace grouping, update bindings and node types, and add the required grouping and disambiguation tests. |
| Docstring Coverage |
⚠️ Warning |
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. |
Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (3 passed)
| Check name |
Status |
Explanation |
| Description Check |
✅ Passed |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check |
✅ Passed |
The title clearly identifies the main change: parser support for boolean shorthand expressions. |
| Out of Scope Changes check |
✅ Passed |
The changes remain focused on boolean shorthand parsing, syntax binding, CST definitions, parser recovery, and related tests. |
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
- Create stacked PR
- Commit on current branch
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
feat/boolean-shorthand-expressions
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 19, 2026
This was referenced Aug 26, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|