fflorent / nom_locate

A special input type for nom to locate tokens
MIT License
221 stars 38 forks source link

Make a complete example with a simple language #52

Open fflorent opened 4 years ago

fflorent commented 4 years ago

It could be really helpful to implement a full example using a simple language like JSON or toml.

https://github.com/Geal/nom/blob/master/examples/json.rs

Originally suggested by @Geal.

bikeshedder commented 3 years ago

I'm using nom + nom_locate in the webwire CLI tool for parsing the IDL:

Language spec: https://webwire.dev/idl.html Parser implementation: https://github.com/webwire/webwire-cli/tree/master/src/idl

I consider this to be a rather simple language and the code contains testcases including checks that the parser errors report the correct line and column numbers.