sirthias / parboiled2

A macro-based PEG parser generator for Scala 2.10+
Other
717 stars 86 forks source link

Custom error messages #96

Closed alexeyr closed 9 years ago

alexeyr commented 10 years ago

From documentation, there doesn't seem to be a way to fail with a specified error message (e.g. in test example, I'd like to tell the user only even integers are allowed explicitly). Pergaps an optional argument could be added to mismatch?

alexander-myltsev commented 10 years ago

Good point. I see no easy workaround either. @sirthias do you know any?

sirthias commented 10 years ago

The only way to influence error messages right now is through rule naming. These two commits made that even easier:

However, even more flexibility would certainly be good. So I think this is a valid ticket, thanks for raising the issue!

sirthias commented 9 years ago

Superseded by https://github.com/sirthias/parboiled2/issues/125