Skip to content

Conversation

@TwitchBronBron
Copy link
Member

@TwitchBronBron TwitchBronBron commented Sep 27, 2022

Roku OS 11.5 introduced the continue statement. This PR adds the necessary parsing and transpiling to support using that feature as defined by Roku.

This does not address backwards-compatibile transpiling (i.e. transpile to labels and goto expressions). That effort is still ongoing in #489 and will be addressed at a future time.

@arturocuya
Copy link
Contributor

Does the new Continue statement support plugin annotations?

@TwitchBronBron
Copy link
Member Author

@arturocuya do you mean like this? If so, then no. I believe annotations are currently only applicable to the higher-level things like namespaces and functions.

while true 
    @YourCustomAnnotation
    continue while
end while

@arturocuya
Copy link
Contributor

@TwitchBronBron Ah ok. I was asking because in another project I use brs for testing and it doesn't recognize newer statements like throw, so I exclude them from the compilation using an annotation:

    private sub validateArgs(args as object)
        if ((args.direction <> Direction.row) and (args.direction <> Direction.column))
            if (m.logger <> invalid)
                m.logger.error(ErrorCode.invalidDirection, args.direction)
            end if
            @deviceOnly
            throw ErrorCode.invalidDirection
        end if

@TwitchBronBron
Copy link
Member Author

Oh, well if annotations work with throw, then they should also work for continue, as both are "statements".

@TwitchBronBron TwitchBronBron merged commit fba1c3a into master Sep 27, 2022
@TwitchBronBron TwitchBronBron deleted the continue-parser-support branch September 27, 2022 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants