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

break/continue [label] with and better error handling #1397

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

edemaine
Copy link
Collaborator

No description provided.

ForStatement
FunctionNode
IterationExpression
IterationFamily
IterationStatement
LabeledStatement
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprisingly Labeled is preferred in American English https://www.grammarly.com/blog/labeled-labelled/

Copy link
Contributor

@STRd6 STRd6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but I'd keep it as LabeledStatement to be in line with American English.

@edemaine
Copy link
Collaborator Author

I prefer American English and "labeled" as well, but I was trying to match this unchanged code:

# https://262.ecma-international.org/#prod-LabelledStatement
LabelledStatement
  Label:label LabelledItem:statement ->
    return {
      type: "LabelledStatement",

The types should match the grammar, which this PR achieves. It also seems reasonable for the grammar to match the spelling from the ECMA spec given the overlap. Alternatively, I'm fine with changing everything in the other direction, from Labelled to Labeled.

@STRd6
Copy link
Contributor

STRd6 commented Sep 12, 2024

Good point! Probably best to match the ECMA spec, then default to American English for anything else.

Thanks for the PR!

@edemaine edemaine merged commit a67393f into main Sep 12, 2024
4 checks passed
@edemaine edemaine deleted the break-continue-with-2 branch September 12, 2024 21:55
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.

2 participants