Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop keyword causes parse errors #192

Closed
TwitchBronBron opened this issue Mar 12, 2019 · 3 comments · Fixed by #247
Closed

Stop keyword causes parse errors #192

TwitchBronBron opened this issue Mar 12, 2019 · 3 comments · Fixed by #247
Labels
bug Any difference between this BrightScript implementation and RBI, or otherwise unexpected behavior parser Affects this project's token parser

Comments

@TwitchBronBron
Copy link
Contributor

There are some issues with the stop keyword now, probably introduced in #164.

sub Main()
    'this SHOULD be an error
    stop = 123
    
    'this SHOULD be an error
    stop()

    'this should NOT be an error (but...why would you do this?)
    print stop

    'this should NOT be an error
    stop

    'this should NOT be an error
    if true then stop

    obj = {
        'this should NOT be an error (working correctly right now)
        stop: true
    }
end sub

'this SHOULD be an error
sub Stop()
end sub

'this SHOULD be an error
sub DoSomething(stop as boolean)
    
end sub
@sjbarag sjbarag added this to High priority in Issue Triage Mar 13, 2019
@sjbarag sjbarag moved this from High priority to Needs triage in Issue Triage Mar 13, 2019
@sjbarag sjbarag moved this from Needs triage to Medium Priority in Issue Triage Mar 14, 2019
@sjbarag
Copy link
Owner

sjbarag commented Mar 14, 2019

Thanks for breaking this down, @TwitchBronBron! 😄

@sjbarag sjbarag added bug Any difference between this BrightScript implementation and RBI, or otherwise unexpected behavior parser Affects this project's token parser labels Mar 14, 2019
@sjbarag
Copy link
Owner

sjbarag commented Mar 14, 2019

It appears stop is a reserved word and can be used as a keyword but not always. We may also be missing checks for parameter names that collide with reserved words.

@TwitchBronBron
Copy link
Contributor Author

@sjbarag I'm working on this

Issue Triage automation moved this from Medium Priority to Closed May 29, 2019
sjbarag pushed a commit that referenced this issue May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Any difference between this BrightScript implementation and RBI, or otherwise unexpected behavior parser Affects this project's token parser
Projects
Development

Successfully merging a pull request may close this issue.

2 participants