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

BUG: breakpoint causes valid code to have a syntax error #111

Open
iBicha opened this issue Nov 3, 2022 · 5 comments
Open

BUG: breakpoint causes valid code to have a syntax error #111

iBicha opened this issue Nov 3, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@iBicha
Copy link

iBicha commented Nov 3, 2022

If you put a breakpoint on an object assign which spans multiple lines

Screen Shot 2022-11-02 at 9 26 18 PM

It will show a syntax error (without much explanation)

The transpiled BRS shows

    params = {
STOP
        q: q
    }

Which is not valid BRS

@TwitchBronBron TwitchBronBron transferred this issue from rokucommunity/brighterscript Nov 3, 2022
@TwitchBronBron
Copy link
Member

TwitchBronBron commented Nov 3, 2022

Yeah, that makes sense why it doesn't work. I wonder if there is any way we could inject the stop statement safely in that situation? Like, would something like:

params = { 
    stop; q: q
}

Probably not though.

We don't currently have any validation for where breakpoints are placed. However, we definitely should. Maybe parse the file with the brighterscript compiler and inspect the line to ensure it's going to be placing the breakpoint at a valid location?

@iBicha
Copy link
Author

iBicha commented Nov 19, 2022

Maybe parse the file with the brighterscript compiler and inspect the line to ensure it's going to be placing the breakpoint at a valid location?

Can't think of any other way tbh

@chrisdp
Copy link
Collaborator

chrisdp commented Nov 19, 2022

We should honestly do what Ts does and move it to the next valid stopable line. Like @iBicha says we might be able to do something where we use brighter script to parse and find that next valid location.

@iBicha
Copy link
Author

iBicha commented Nov 19, 2022

We should honestly do what Ts does and move it to the next valid stopable line. Like @iBicha says we might be able to do something where we use brighter script to parse and find that next valid location.

Actually it's not a lot of effort for the dev to move the breakpoint themselves. The problem is not knowing why it is failing. So if detection is easier than prevention, it's definitely a good path with just a good error message

@chrisdp
Copy link
Collaborator

chrisdp commented Nov 19, 2022

@iBicha i think that what I was getting at is that detecting it is almost as much as moving it for them since we need to understand all invalid locations. But yea an error would help as well.

@TwitchBronBron TwitchBronBron added the bug Something isn't working label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants