top | item 37771047

(no title)

flaghacker | 2 years ago

Could you share the repo? I've been curious what nontrivial parsers look like woth nom, I always lose the overview pretty quickly.

discuss

order

TimWolla|2 years ago

I'm using nom to parse a simple access control DSL in https://github.com/wbbaddons/Tims-PackageServer/blob/master/.... You can see how it looks in the tests of the linked file.

The DSL supports comparison operators, '&&', '||' and nested expressions, while preventing mixing of '&&' and '||' without making precedence clear using parentheses. This DSL should fit 'non-trivial', but it still should be simple enough to easily understand it.