| 1 | ; Scopes |
| 2 | |
| 3 | [ |
| 4 | (function_definition) |
| 5 | (subshell) |
| 6 | ] @local.scope |
| 7 | |
| 8 | ; Definitions |
| 9 | |
| 10 | (variable_assignment |
| 11 | name: (variable_name) @local.definition.variable) |
| 12 | |
| 13 | ; `local`/`declare`/`export x` etc. bind a bare name. |
| 14 | (declaration_command |
| 15 | (variable_name) @local.definition.variable) |
| 16 | |
| 17 | (for_statement |
| 18 | variable: (variable_name) @local.definition.variable) |
| 19 | |
| 20 | ; References |
| 21 | |
| 22 | (variable_name) @local.reference |