Fork me on GitHub
#instaparse
<
2016-08-19
>
seylerius02:08:59

Hrm. Is there a way to make some tokens higher priority than others? This parser (http://sprunge.us/hFCU) eats the entire input file, failing to break out the initial metadata.

seylerius02:08:32

When I try to make the content token reluctant (adding a ? to the *), it fails to match when the content section begins.

dave14:08:28

define a rule that could be one or the other, using / instead of |, and put the one you prefer first

dave14:08:32

although, it looks like your title rule is probably consuming everything

dave14:08:50

that will consume everything

seylerius14:08:05

Nope, it's not eating newlines.

seylerius14:08:15

This looks like it's going to do it.

dave14:08:18

oh, you're right!

aengelberg16:08:34

@uwo: instaparse doesn't print anything when a failure occurs. It returns a instaparse.Failure object which happens to print in a special way at the REPL