Fork me on GitHub
#instaparse
<
2018-01-22
>
xiongtx03:01:06

Does the order of rules for Instaparse matter? I seem to recall that rule order didn't for tools like Lex/JLex...but I could be wrong.

aengelberg03:01:04

The order of rules in an alternation does not matter, if that's what you're asking.

xiongtx03:01:21

I meant the statements themselves; but funny you should bring that up, b/c I was just wondering about the order of alternations as well.

xiongtx03:01:00

For

type = 'int' | 'boolean' | className

className = identifier

identifier = #"[A-Za-z_]+[A-Za-z0-9_]*"
Is there a way to the order of alternations matter, i.e. (insta/parse parser "int") return {:type "int"] instead of (from my observation) [:type [:className [:identifier "int"]]]?