Linter for (Pygments) regular expressions
Project description
Regexlint will examine all regular expressions in an importable Pygments lexer, and report things that are probably not doing what you think they’re doing. For example, patterns like:
(elseif|else)
It can also warn about a few syntax problems, for example this has two problems – the s+ outside the groups, and not enough actions in bygroups:
(r'(foo)\s+(bar)', bygroups(Blah)),
Usage
make demo or python2 cmdline.py pygments.lexers.web or python2 cmdline.py pygments.lexers.web:HtmlLexer
Todo
Figure out which phase should remove unnecessary backslashes
Write the alternation expander, so that ([ax]|a[bc]) fails the alternation order checks
Make more general than just for Pygments
License
This project is licensed under the Apache Public License, see COPYING
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file regexlint-0.9.tar.gz
.
File metadata
- Download URL: regexlint-0.9.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c77f237751c1dd72d051bdf4d781b0701c05305e9a8414a1edcfcc271ab5679 |
|
MD5 | a09f8adef66ec15771a62951b260ead5 |
|
BLAKE2b-256 | 9285463ac7e093df766276241c2b7efe4b8fc69f99882fa5368fe72986b3a66c |