UpstandingHackers/hammer — pull request #106 by pesco (2014-06-18 20:15:41+00:00)
Title: add h_permutation

please have a look. it differs from

http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=D04D91DBBCDDDF3D364C17C4DAD59606?doi=10.1.1.20.8347&rep=rep1&type=pdf

in that there is no "sublanguage" for describing permutation parsers. you can use your regular `HParser`s as arguments to `h_permutation`. optional elements work with `h_optional` as one would intuitively expect. what is not supported in the same way, in relation to the above paper, are optional elements with default values. you can have a parser that is a choice with a default branch of course, but the difference is that it might be tried too early, depending on its place in the argument list, and default even though it could match later. so to get the same result, one would have to use plain optionals and replace the `TT_NONE` results with default values after the fact.