@bwstearns sorry, didn't see your question until now. The instaparse ABNF notation (which is explained in ABNF.md
) supports repetition with any lower and/or upper bound. e.g. (insta/parser "S = 3*5('a')" :input-format :abnf)
matches 3 to 5 a
s. The default EBNF notation does not support it, so unless you want to switch to ABNF (a few conventions would have to change) then merging in combinators is the best approach.
@aengelberg: Sorry, I should have followed up with what I found, which is pretty much what you just said lol. I ended up implementing it by making a rep combinator and merging it into the main grammar, and then after looking at how unreadable it was getting I just threw a #'\d\d' regex at it (or something similar, I forget which part of the thing I was trying to parse). Thanks for following up though. Also, I knew I recognized you from something. Really enjoyed the automata presentation (I am of the youtube audience, haven’t had the good fortune to get to a clojure event in person yet).