You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
If you run parseTree on it, it parses fine (which is cool), but the error that is reported has no other information than the error code. It would be nice if each error also contained the location information so they could be found in source (for example in an editor or IDE).
Information that would be handy to have:
the starting offset of the error
the length of the bad stuff
the column start of the error
the line number
The text was updated successfully, but these errors were encountered:
@aeschli Would you prefer a) additional (redundant) members in ParseError ... or b) some utility function (jsonText: string, error: ParserError) => { line: number; column: number }?
I tend to option a (+ making the members of ParseErrorreadonly).
Further: Should the numbers be 0-based (like in the TypeScript-API), or 1-based (like in the majority of similar language-parsing APIs)?
Consider the following snippet:
If you run
parseTreeon it, it parses fine (which is cool), but the error that is reported has no other information than the error code. It would be nice if each error also contained the location information so they could be found in source (for example in an editor or IDE).Information that would be handy to have:
The text was updated successfully, but these errors were encountered: