Closed CalebLItalien closed 3 weeks ago
@tbreimer14 are you using the match statement code for this? I think the match statement code should be pretty similar.
Exactly what I've been doing! Just think we need a parse_case_block method too to handle "break;" indicating the end of a case body.
We already have a 'parse_break' I believe? Do we want it to be a parser error if there isn't a break statement in a case?
Right, I forgot we don't actually need a break token to end a case block. I don't see a parse_break on the frontend branch, is that supposed to parse the token? I think we would still need a special method to parse a case body though, since it would end when the next case started, and not with a "}" like parse_block expects. Definitely could be wrong though, let me know if I'm misunderstanding something.
Details
Add support for
switch
,case
, anddefault
to the parser through a single unified functionparse_switch_statement
.Issue Type
Requirements
Notes