rokucommunity / bslint

A linter for BrightScript and BrighterScript.
MIT License
27 stars 15 forks source link

inline function params fail when there is no type; but that is not legal in regular brs #63

Closed georgejecook closed 2 years ago

georgejecook commented 2 years ago

I can add these, as I use them in bs, with my maestro-bsc-plugin; but it presently crashes roku-formatter: @TwitchBronBron tells me that this use is not regular brs; so I guess that bslint should either:

TwitchBronBron commented 2 years ago

I thought there was a limitation to the way you could define anonymous function parameters, but now I can't reproduce the issues I was seeing before.

sub main()
    message = (function(name = "bob" as string)
                             ~~~~~~~~~~~~~~~~~ I thought some part of this was a syntax error in the past?
        return "hello " + name
    end function)("world")
end sub

I'll look into what could be causing the parse issues in brighterscript-formatter.