Hacker News new | ask | show | jobs
by flaghacker 986 days ago
Could you share the repo? I've been curious what nontrivial parsers look like woth nom, I always lose the overview pretty quickly.
1 comments

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.