tree-sitter / tree-sitter-julia

Julia grammar for Tree-sitter
MIT License
93 stars 32 forks source link

Error parsing parametric method without {} around parameter #60

Closed fredrikekre closed 1 year ago

fredrikekre commented 1 year ago

If you only have one parameter it is optional to use curly braces. Source:

function foo(x::T) where T
end

Playground:

function_definition [0, 0] - [1, 3]
  name: identifier [0, 9] - [0, 12]
  parameters: parameter_list [0, 12] - [0, 18]
    typed_parameter [0, 13] - [0, 17]
      identifier [0, 13] - [0, 14]
      identifier [0, 16] - [0, 17]
  identifier [0, 19] - [0, 24]
  ERROR [0, 25] - [0, 26]
    identifier [0, 25] - [0, 26]