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

Syntax parsing error: curly braces in a 'case' statement #251

Open
Bindernews opened this issue Aug 8, 2024 · 1 comment
Open

Syntax parsing error: curly braces in a 'case' statement #251

Bindernews opened this issue Aug 8, 2024 · 1 comment
Labels
🌳 parser 🆘 help wanted Lower priority for Bscotch, so external help needed to resolve wontfix This will not be worked on

Comments

@Bindernews
Copy link

Stitch reports a syntax error when there are curly braces after a case statement.
While this isn't necessarily best syntax practice, it IS valid syntax, and the person
who made the project I'm now working on uses it extensively.

switch (foo)
{
  case 1:
  {  // "Expecting token of type --> EndBrace <-- but found --> '{' <--"
    // other things
  }
}
@adam-coster
Copy link
Member

This is a known issue, which I've not been able to address. I couldn't get the parser to work when allowing for extraneous curlies, and since they're non-functional anyway I didn't spend too much time fighting it and instead removed the few we had from our projects.

I can only prioritize Stitch features that our team needs, and unfortunately this isn't one of them!

That said, I'm not inherently against having this supported in Stitch. It's just not something I'll be implementing myself. So if someone else can figure out how to update the parser logic to allow for extraneous curlies I'm happy to take the PR.

For reference, the parser logic is in a subproject in this repo: packages/parser

@adam-coster adam-coster added 🆘 help wanted Lower priority for Bscotch, so external help needed to resolve wontfix This will not be worked on 🌳 parser labels Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌳 parser 🆘 help wanted Lower priority for Bscotch, so external help needed to resolve wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants