| 1 | ; (stmt_let) @assignment.outer |
| 2 | |
| 3 | ; (stmt_mut) @assignment.outer |
| 4 | |
| 5 | ; (stmt_const) @assignment.outer |
| 6 | |
| 7 | ; (stmt_let |
| 8 | ; value: (_) @assignment.inner) |
| 9 | |
| 10 | ; (stmt_mut |
| 11 | ; value: (_) @assignment.inner) |
| 12 | |
| 13 | ; (stmt_const |
| 14 | ; value: (_) @assignment.inner) |
| 15 | |
| 16 | ; (block) @block.outer |
| 17 | |
| 18 | (comment) @comment.around |
| 19 | |
| 20 | ; (pipeline) @pipeline.outer |
| 21 | |
| 22 | ; (pipe_element) @pipeline.inner |
| 23 | |
| 24 | (decl_def) @function.around |
| 25 | |
| 26 | (decl_def |
| 27 | body: (_) @function.inside) |
| 28 | |
| 29 | ; (ctrl_for) @loop.outer |
| 30 | |
| 31 | ; (ctrl_loop) @loop.outer |
| 32 | |
| 33 | ; (ctrl_while) @loop.outer |
| 34 | |
| 35 | ; (ctrl_for |
| 36 | ; body: (_) @loop.inner) |
| 37 | |
| 38 | ; (ctrl_loop |
| 39 | ; body: (_) @loop.inner) |
| 40 | |
| 41 | ; (ctrl_while |
| 42 | ; body: (_) @loop.inner) |
| 43 | |
| 44 | ; Conditional inner counts the last one, rather than the current one. |
| 45 | ; (ctrl_if |
| 46 | ; then_branch: (_) @conditional.inner |
| 47 | ; else_block: (_)? @conditional.inner) @conditional.outer |
| 48 | |
| 49 | (parameter) @parameter.around |
| 50 | |
| 51 | ; (command |
| 52 | ; head: (_) @call.inner) @call.outer |
| 53 | |
| 54 | ; (where_command |
| 55 | ; predicate: (_) @call.inner) @call.outer |
| 56 | |
| 57 | ; define pipeline first, because it should only match as a fallback |
| 58 | ; e.g., `let a = date now` should match the whole assignment. |
| 59 | ; But a standalone `date now` should also match a statement |
| 60 | ; (pipeline) @statement.outer |
| 61 | |
| 62 | ; (stmt_let) @statement.outer |
| 63 | |
| 64 | ; (stmt_mut) @statement.outer |
| 65 | |
| 66 | ; (stmt_const) @statement.outer |
| 67 | |
| 68 | ; (ctrl_if) @statement.outer |
| 69 | |
| 70 | ; (ctrl_try) @statement.outer |
| 71 | |
| 72 | ; (ctrl_match) @statement.outer |
| 73 | |
| 74 | ; (ctrl_while) @statement.outer |
| 75 | |
| 76 | ; (ctrl_loop) @statement.outer |
| 77 | |
| 78 | ; (val_number) @number.inner |