euclidianAce / tree-sitter-teal

A tree sitter grammar for Teal, a typed dialect of Lua
38 stars 4 forks source link

Function scope #15

Closed Xandaros closed 1 year ago

Xandaros commented 3 years ago

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])
euclidianAce commented 3 years ago

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