Closed monaqa closed 1 year ago
tree-sitter --version
tree-sitter 0.20.8
If the first (non-blank / non-comment) line starts with #!, even if it should be parsed as an inner_attribute_item, it is regarded as a shebang.
#!
(source_file [0, 0] - [3, 0] (shebang [0, 0] - [0, 27]) (function_item [2, 0] - [2, 12] name: (identifier [2, 3] - [2, 7]) parameters: (parameters [2, 7] - [2, 9]) body: (block [2, 10] - [2, 12])))
(source_file [0, 0] - [3, 0] (inner_attribute_item [0, 0] - [0, 27] (attribute [0, 3] - [0, 26] (identifier [0, 3] - [0, 8]) arguments: (token_tree [0, 8] - [0, 26] (identifier [0, 9] - [0, 25])))) (function_item [2, 0] - [2, 12] name: (identifier [2, 3] - [2, 7]) parameters: (parameters [2, 7] - [2, 9]) body: (block [2, 10] - [2, 12])))
#![allow(unused_variables)] fn main() {}
Thanks, fixed on master
Thanks for the quick fix!
Did you check existing issues?
Tree-Sitter CLI Version, if relevant (output of
tree-sitter --version
)tree-sitter 0.20.8
Describe the bug
If the first (non-blank / non-comment) line starts with
#!
, even if it should be parsed as an inner_attribute_item, it is regarded as a shebang.Steps To Reproduce/Bad Parse Tree
Expected Behavior/Parse Tree
Repro