Conversation
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #499 +/- ##
=======================================
Coverage 67.91% 67.92%
=======================================
Files 63 63
Lines 3079 3083 +4
Branches 573 574 +1
=======================================
+ Hits 2091 2094 +3
Misses 805 805
- Partials 183 184 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix syntax error in jcasbin matcher expression
Fix 'in' operator parsing for tuple literals in matcher expressions
Jan 7, 2026
hsluoyz
pushed a commit
that referenced
this pull request
Jan 7, 2026
hsluoyz
added a commit
that referenced
this pull request
Jan 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
jCasbin failed to parse
inoperator expressions with tuple literals liker.obj in ('data2', 'data3'), throwing syntax errors. The regex pattern couldn't handle commas, single quotes, or spaces within parentheses.Changes
Updated regex pattern from
([a-zA-Z0-9_.()\"]*) +in +([a-zA-Z0-9_.()\"]*)to([^\s]+?) +in +(\([^)]*\)|\S+)to match parenthesized expressions and handle tuple syntaxAdded smart tuple conversion in
replaceInSyntaxWithInclude(): converts comma-separated parenthesized expressions to AviatorScript'stuple()function, while preserving single values and variablesAdded comprehensive test coverage for tuple literals with various quote styles, multiple
inoperators, and edge casesExample
The conversion logic checks for commas to distinguish tuple literals from parenthesized values:
('data2', 'data3')→tuple('data2', 'data3')✓("bob")→("bob")(preserved)someArray→someArray(preserved)Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.