Skip to content

Commit

Permalink
Add support for form-from comprehensions
Browse files Browse the repository at this point in the history
  • Loading branch information
chrhansk committed Dec 8, 2024
1 parent a1c9c26 commit be91184
Show file tree
Hide file tree
Showing 5 changed files with 233,113 additions and 211,387 deletions.
16 changes: 15 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -780,12 +780,26 @@ module.exports = grammar(Python, {
),
),

_comprehension_for_clause: $ =>
choice($.for_in_clause,
seq(optional("async"),
"for",
$.for_from_loop),
),

_comprehension_clauses: $ => seq(
$._comprehension_for_clause,
repeat(choice(
$._comprehension_for_clause,
$.if_clause,
)),
),

for_in_loop: $ =>
seq(
field("left", $._left_hand_side),
"in",
field("right", $._expressions),
field("right", $._expression_within_for_in_clause),
),

for_from_relation: $ =>
Expand Down
40 changes: 37 additions & 3 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 20 additions & 8 deletions src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit be91184

Please sign in to comment.