These are chat archives for pest-parser/pest

15th
Feb 2017
Sunjay Varma
@sunjay
Feb 15 2017 00:52
Is there a way to get position information from pest?
Here's what I want to do: parse a programming language and embed position information in each node of the AST so I can provide useful error messages
Dragoș Tiselice
@dragostis
Feb 15 2017 00:53
Of course. The resulting Token has a start and end position.
Sunjay Varma
@sunjay
Feb 15 2017 00:54
Is there an example of how to build an AST using pest?
The calculator example directly evaluates the parsed information
This is a very simple example.
Sunjay Varma
@sunjay
Feb 15 2017 00:55
Thank you!
I'll take a look
Really frustrated with nom's error handling. It's so general that it's really difficult to do a lot of things
I think pest will work better :)
Dragoș Tiselice
@dragostis
Feb 15 2017 00:56
But, bear in mind that the process! macro will be deprecated for a different API made with Stream.
Sunjay Varma
@sunjay
Feb 15 2017 00:57
Is that your currently open pull request?
Dragoș Tiselice
@dragostis
Feb 15 2017 00:57
pest has the expected method that can help.
Yes. I'm still working on it. I wish I had more docs on it.
Sunjay Varma
@sunjay
Feb 15 2017 00:57
Okay that's no problem. As long as there are eventually docs on how to upgrade properly I think it should be fine
:D
Dragoș Tiselice
@dragostis
Feb 15 2017 00:58
I'd also offer to help once 1.0 is published. :)
Sunjay Varma
@sunjay
Feb 15 2017 00:58
Awesome!
Dragoș Tiselice
@dragostis
Feb 15 2017 00:59
pest is designed to be easy to use for beginners and it's tailored for programming languages. Error reporting may be a bit basic, but it can be extended with specialized grammar.
Sunjay Varma
@sunjay
Feb 15 2017 01:01
That's exactly what I'm looking for. I built a parser using nom first. It's a great library, but it has a number of downsides. It's really difficult to maintain because the macros are really hard to debug and error handling is really confusing. I'm going to try to reimplement it using pest and see if it works better :D
Dragoș Tiselice
@dragostis
Feb 15 2017 01:06
pest could be a good fit. Let me know how things work out.
Laurent Wandrebeck
@lwandrebeck
Feb 15 2017 08:54
yeah, documentation \o/