tree-sitter-teal icon indicating copy to clipboard operation
tree-sitter-teal copied to clipboard

Function scope

Open Xandaros opened this issue 3 years ago • 1 comments

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])

Xandaros avatar Jul 04 '21 09:07 Xandaros

I think I'm going to hold off on this one due to these issues

I think it was mentioned on matrix/gitter that there might be some syntax/semantic change related to this

euclidianAce avatar Jul 05 '21 17:07 euclidianAce