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

Unit switch with lookahead routing to block not understood by Spicy parser #1971

Open
bbannier opened this issue Feb 2, 2025 · 0 comments
Open
Labels
Compiler Feature Request Request for new functionality

Comments

@bbannier
Copy link
Member

bbannier commented Feb 2, 2025

I would like to use a unit switch with lookahead and add a block with multiple parsers to a case. This works for unit switch over expressions, but not for lookahead.

type X = unit {
    switch {
        -> { # ERROR: syntax error, unexpected '{', expecting ':'
            : b"a";
            : b"a";
        }
        -> : b"b";
    };
};

To model something like this I would need to move the block to its own unit.

I am marking this Feature Request, but I am pretty sure it is just an unintended limitation in our parser.

@bbannier bbannier added Compiler Feature Request Request for new functionality labels Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compiler Feature Request Request for new functionality
Projects
None yet
Development

No branches or pull requests

1 participant