3 ms·
Could you share the repo? I've been curious what nontrivial parsers look like woth nom, I always lose the overview pretty quickly.
by karelpeeters 3y ago
Could you share the repo? I've been curious what nontrivial parsers look like woth nom, I always lose the overview pretty quickly.
- TimWolla 3y agoI'm using nom to parse a simple access control DSL in https://github.com/wbbaddons/Tims-PackageServer/blob/master/src/auth/acl/ruleset.rs 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.