Example Of Writing a Parser With Fancy Error Messages

Hey everybody, I was just playing around and put together a simple example of using Rust PEG for writing a parser and using Chic for error printing.

It is a little sloppy, because I was just messing around, but it shows how to parse a list of numbers and give nice error messages such as this:

error: Parser error
  |
4 | [ 1, 3,4, 5,
5 | 6,
6 | 
7 | 8, 9, 10, 7,10d]
  |               ^ Expected: one of ",", "]"
  |
3 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.