winnow-rs / winnow

Making parsing a breeze
https://docs.rs/winnow
Other
573 stars 46 forks source link

Pratt example #622

Open 39555 opened 1 week ago

39555 commented 1 week ago

An example of the usage of the Pratt parser for parsing a weird cexpr.

The result of the parsing is a nicely formatted ast and the expression in prefix notation.

1 + 2 + 3:

ADD
  ADD
    VAL 1
    VAL 2
  VAL 3

(+ (+ 1 2) 3)

Parser Problems

39555 commented 1 week ago

Well, the example is complete and all the features are there! I assume with #618 it would be the same. I may check it later.

epage commented 6 days ago

@39555 I have to say, I am thoroughly impressed with the dedication you have put to this investigation, having