|
416 | 416 | attr (@if.node) _location_end = (location-end @expr) |
417 | 417 | } |
418 | 418 |
|
419 | | -(generator_expression . "(" . (comment)* . (expression) @start (for_in_clause) @child [(for_in_clause) (if_clause)] @end . (comment)* . ")" .) @genexpr |
| 419 | +(generator_expression . "(" . (comment)* . (expression) @start (for_in_clause) @child [(for_in_clause) (if_clause)] @end . (comment)* . ")" .) @_genexpr |
420 | 420 | { |
421 | 421 | attr (@child.node) _location_start = (location-start @start) |
422 | 422 | attr (@child.node) _location_end = (location-end @end) |
423 | 423 | } |
424 | 424 |
|
425 | | -(generator_expression . "(" . (comment)* . (expression) @start (for_in_clause) @end . (comment)* . ")" .) @genexpr |
| 425 | +(generator_expression . "(" . (comment)* . (expression) @start (for_in_clause) @end . (comment)* . ")" .) @_genexpr |
426 | 426 | { |
427 | 427 | attr (@end.node) _location_start = (location-start @start) |
428 | 428 | attr (@end.node) _location_end = (location-end @end) |
|
524 | 524 | attr (@del.node -> @target.node) targets = (named-child-index @target) |
525 | 525 | } |
526 | 526 |
|
527 | | -(delete_statement target: (_) @target) @del |
| 527 | +(delete_statement target: (_) @target) @_del |
528 | 528 | { |
529 | 529 | attr (@target.node) ctx = "del" |
530 | 530 | } |
|
798 | 798 |
|
799 | 799 | (dictionary_comprehension |
800 | 800 | body: (pair |
801 | | - key: (_) @key |
802 | | - value: (_) @value |
| 801 | + key: (_) @_key |
| 802 | + value: (_) @_value |
803 | 803 | ) |
804 | 804 | ) @genexpr |
805 | 805 | { |
|
1299 | 1299 | ; the index of the left-hand side of the current assignment. |
1300 | 1300 |
|
1301 | 1301 | ; Base case, for the outermost assignment we set the outermost node to this node, and the index to zero. |
1302 | | -(expression_statement (assignment !type) @assign) @expr |
| 1302 | +(expression_statement (assignment !type) @assign) @_expr |
1303 | 1303 | { |
1304 | 1304 | let @assign.outermost_assignment = @assign.node |
1305 | 1305 | let @assign.target_index = 0 |
|
1358 | 1358 | } |
1359 | 1359 |
|
1360 | 1360 | (assignment |
1361 | | - left: (_) @target |
| 1361 | + left: (_) @_target |
1362 | 1362 | type: (_) |
1363 | 1363 | right: (_) @value |
1364 | 1364 | ) @assign |
|
2330 | 2330 | attr (@operand.node) ctx = "load" |
2331 | 2331 | } |
2332 | 2332 |
|
2333 | | -(unary_operator "~" @op) @unaryop |
| 2333 | +(unary_operator "~" @_op) @unaryop |
2334 | 2334 | { |
2335 | 2335 | attr (@unaryop.node) op = "~" |
2336 | 2336 | } |
|
2614 | 2614 | ; Async status |
2615 | 2615 | ; NOTE: We only set the `is_async` field on the _first_ clause of the `with` statement, |
2616 | 2616 | ; as this is the behaviour of the old parser. |
2617 | | -(with_statement "async" "with" @with_keyword (with_clause . (with_item) @with)) |
| 2617 | +(with_statement "async" "with" @_with_keyword (with_clause . (with_item) @with)) |
2618 | 2618 | { |
2619 | 2619 | attr (@with.node) is_async = #true |
2620 | 2620 | } |
|
2800 | 2800 | (identifier) @obj |
2801 | 2801 | . |
2802 | 2802 | (identifier) @attr |
2803 | | -) @match_value_pattern |
| 2803 | +) @_match_value_pattern |
2804 | 2804 | { |
2805 | 2805 | let attribute = (ast-node @attr "Attribute") |
2806 | 2806 | attr (@attr.node) _skip_to = attribute |
|
2814 | 2814 | (match_value_pattern |
2815 | 2815 | . |
2816 | 2816 | (identifier) @id |
2817 | | -) @match_value_pattern |
| 2817 | +) @_match_value_pattern |
2818 | 2818 | { |
2819 | 2819 | attr (@id.node) ctx = "load" |
2820 | 2820 | } |
|
3267 | 3267 | (decorated_definition |
3268 | 3268 | (decorator (expression) @exp1) @dec1 |
3269 | 3269 | . (comment)* . |
3270 | | - (decorator (expression) @exp2) @dec2 |
3271 | | -) @decorator |
| 3270 | + (decorator (expression) @_exp2) @dec2 |
| 3271 | +) @_decorator |
3272 | 3272 | { |
3273 | 3273 | attr (@dec1.node) func = @exp1.node |
3274 | 3274 | edge @dec1.node -> @dec2.node |
|
3279 | 3279 | (decorator (expression) @exp) @last |
3280 | 3280 | . (comment)* . |
3281 | 3281 | definition: (function_definition) @funcdef |
3282 | | -) @decorator |
| 3282 | +) @_decorator |
3283 | 3283 | { |
3284 | 3284 | attr (@last.node) func = @exp.node |
3285 | 3285 | edge @last.node -> @funcdef.funcexpr |
|
3291 | 3291 | (decorator (expression) @exp) @last |
3292 | 3292 | . (comment)* . |
3293 | 3293 | definition: (class_definition) @class |
3294 | | -) @decorator |
| 3294 | +) @_decorator |
3295 | 3295 | { |
3296 | 3296 | attr (@last.node) func = @exp.node |
3297 | 3297 | edge @last.node -> @class.class_expr |
|
0 commit comments