Skip to content

Commit

Permalink
Merge pull request #5 from sourcery-ai/nick/fix/with-item-precedence
Browse files Browse the repository at this point in the history
fix: with item precedence for multiple context managers with brackets
  • Loading branch information
Hellebore authored Nov 17, 2022
2 parents f743293 + d0eca66 commit 89f97a5
Show file tree
Hide file tree
Showing 5 changed files with 1,523 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 16
- run: npm install
- run: npm test
test_windows:
Expand All @@ -26,6 +26,6 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 16
- run: npm install
- run: npm run-script test-windows
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ module.exports = grammar({
seq('(', commaSep1($.with_item), ')')
),

with_item: $ => prec.dynamic(-1, seq(
with_item: $ => prec.dynamic(1, seq(
field('value', $.expression),
)),

Expand Down
2 changes: 1 addition & 1 deletion src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,7 @@
},
"with_item": {
"type": "PREC_DYNAMIC",
"value": -1,
"value": 1,
"content": {
"type": "SEQ",
"members": [
Expand Down
Loading

0 comments on commit 89f97a5

Please sign in to comment.