DanielXMoore / Civet

A TypeScript superset that favors more types and less typing
https://civet.dev
MIT License
1.36k stars 29 forks source link

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

Closed edemaine closed 2 weeks ago

edemaine commented 2 weeks ago

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 commented 2 weeks ago

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

Thanks for the PR!