tree-sitter / tree-sitter-julia

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

Allow function definitions in `local` and `global` declarations #102

Closed wangl-cc closed 1 year ago

wangl-cc commented 1 year ago

Defining functions with local or global declarations works for julia parser, and it can be useful in certain cases:

In [25]: let
             global foo() = 1
             let
                 local foo() = 2
             end
         end
Out[25]: #7#foo (generic function with 1 method)

and https://github.com/JuliaLang/julia/blob/master/base/coreio.jl.

savq commented 1 year ago

LGTM.

Thanks for the PR. Sorry for taking so long to review.