unsplash / intlc

Compile ICU messages into code. Supports TypeScript and JSX. No runtime.
MIT License
56 stars 3 forks source link

Report all dataset parse failures #114

Closed samhh closed 2 years ago

samhh commented 2 years ago

Closes #113, though I'd still like to improve the story around line numbers and such.

Given:

{
  "f": {
    "message": "{x, bad1}"
  },
  "g": {
    "message": "{y, bad2}"
  }
}

Before:

$ intlc compile <file> -l <locale>
f:1:5:
  |
1 | {x, bad1}
  |     ^^^^^
unexpected "bad1}"
expecting "boolean", "date", "number", "plural", "select", "selectordinal", "time", or white space

After:

$ intlc compile <file> -l <locale>
f:1:5:
  |
1 | {x, bad1}
  |     ^^^^^
unexpected "bad1}"
expecting "boolean", "date", "number", "plural", "select", "selectordinal", "time", or white space

g:1:5:
  |
1 | {y, bad2}
  |     ^^^^^
unexpected "bad2}"
expecting "boolean", "date", "number", "plural", "select", "selectordinal", "time", or white space