Add common patterns in code
- Dominant language
- Python
- Stars
- 51
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
The documentation has some [common patterns](https://github.com/goodmami/pe/blob/main/docs/guides/common-patterns.md) defined, but it would also be useful to have some defined in code. But until there's a feature to add external definitions (e.g., a parameter to `pe.compile()` or some kind of `import` syntax within a grammar), these patterns will only be useful for non-parsed grammars using [operator](https://github.com/goodmami/pe/blob/main/docs/api/pe.operators.md) primitives.
More inspiration:
* Lark has some basics, like digits and whitespace ([link](https://github.com/lark-parser/lark/blob/master/lark/grammars/common.lark))
* PEG.js includes unicode categories ([link](https://github.com/pegjs/pegjs/blob/b7b87ea8aeeaa1caf096e2da99fd95a971890ca1/src/parser.pegjs#L441-L495))
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.