Fork me on GitHub
#instaparse
<
2018-04-19
>
gfredericks00:04:59

we're relying on the greediness of .* to definitely eat the \n even though it`s got a ? on it?

aengelberg00:04:41

well, . by default means non-newline chars in regex-land

gfredericks00:04:47

the \n? had me worried that it might parse [" foo" " bar"] from " foo bar"

aengelberg00:04:57

but yes we are relying on the greediness

aengelberg00:04:24

#".*(\n|$)" might be safer

aengelberg00:04:17

btw I believe @dave has some prior art on nested parsers for Alda

aengelberg00:04:28

actually just kidding I think he migrated away from instaparse in more recent versions of Alda

dave01:04:22

indeed, i ended up rolling my own parser, mostly in the hope that someday we can start to asynchronously process parsed expressions/statements as they are parsed -- meaning that a score could start playing before it's even done being parsed

dave01:04:39

...although in doing so, performance got significantly better, to the extent that we might never need to do that 😄

dave01:04:08

before moving away from instaparse, i was doing some pretty complicated stuff with multiple grammars. it was starting to make my head hurt a little, so that may have had something to do with the decision too

dave01:04:53

the grammars needed to share some rules with each other, so i was defining grammars using bits and pieces strung together

dave01:04:38

the reason for that was basically to try and get better perf (without being super knowledgeable about how to improve parser performance otherwise), instead of a big master grammar like i had before, i started parsing out large chunks with more specialized grammars, and do the parsing in multiple passes