tree-sitter-teal
tree-sitter-teal copied to clipboard
Function scope
Depends on #13
The inlining done previously does not actually work - there is never a scope
field.
Functions without an explicit scope would also not be parsed correctly at all. For example:
function x()
end
Got parsed as:
program [0, 0] - [2, 0])
ERROR [0, 0] - [1, 3])
identifier [0, 9] - [0, 10])
Instead of:
program [0, 0] - [2, 0])
function_statement [0, 0] - [1, 3])
name: identifier [0, 9] - [0, 10])
signature: function_signature [0, 10] - [0, 12])
arguments: arguments [0, 10] - [0, 12])
body: function_body [1, 0] - [1, 3])