moritz / json

A tiny JSON parser and emitter for Perl 6 on Rakudo
A JSON parser and emitter for Perl 6 on Rakudo
76 stars 16 forks source link

Detailed error message on parse failures? #26

Open agentzh opened 7 years ago

agentzh commented 7 years ago

I wonder if this library can do detailed error reporting on invalid JSON inputs. Right now it does not indicate the offending location in the potentially large JSON input strings nor it reports that grammatical symbols the parser was expecting that that offending location.

moritz commented 7 years ago

:+1: to reporting the position. Reporting the grammatical symbols that the parser expects tends to produce rather confusing results if done in a generic way, so I tend to favor manually inserted guard clauses.