instaparse

If you're not trampolining your parser, why bother getting up in the morning?
seylerius 2016-07-05T00:35:38.000069Z

@aengelberg: I'm trying to make blank lines in one parser flag as :blank, but they're staying as empty seqs. Parser: http://sprunge.us/RcOf Tester: http://sprunge.us/GGdK

aengelberg 2016-07-05T00:39:18.000070Z

currently that parser doesn't account for any newlines (`\n`) between the lines / blank lines, is that intentional?

seylerius 2016-07-05T00:54:42.000071Z

The library I'm modifying reads the file into a line-seq initially, so I'm mostly just going with that.

seylerius 2016-07-05T19:26:37.000072Z

@aengelberg: Think it would be easier if it was parsing the original, and not a line-seq?

aengelberg 2016-07-05T19:30:27.000073Z

it may be useful to, instead of line-seq, use a different parser on the original input that identifies the sections / subsections but not the inline syntax.

seylerius 2016-07-05T19:32:11.000074Z

Yeah. I'm already splitting it into multiple instaparsers. I take it insta can handle multi-line input?

aengelberg 2016-07-05T19:34:03.000075Z

yeah, just make sure all your strings / regexes handle them. All characters are equal citizens in instaparse input, it's up to the grammar to handle what it wants to handle. And make sure the grammar handles CRLFs (`\r\n`) which may appear.

seylerius 2016-07-05T22:22:16.000076Z

@aengelberg: So make sure my regexps are multi-line and whatnot?

aengelberg 2016-07-05T22:27:27.000077Z

yep

aengelberg 2016-07-05T22:27:44.000078Z

e.g. . inside a regex matches any non-newline character

aengelberg 2016-07-05T22:35:52.000079Z

also, \s inside a regex handles any kind of whitespace (including newlines)

seylerius 2016-07-05T22:40:54.000080Z

Good caveats to know, thanks