Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a lexer for Verifpal #2430

Merged
merged 5 commits into from May 24, 2023
Merged

Add a lexer for Verifpal #2430

merged 5 commits into from May 24, 2023

Conversation

jvoisin
Copy link
Contributor

@jvoisin jvoisin commented May 15, 2023

Verifpal website: https://verifpal.com/
Verifpal "spec": https://verifpal.com/res/pdf/manual.pdf
Verifpal extension for VSCode: https://source.symbolic.software/verifpal/verifpal-vscode

I'm the author of the testfile, so no licensing issues there :)

pygments/lexers/verifpal.py Outdated Show resolved Hide resolved
pygments/lexers/verifpal.py Outdated Show resolved Hide resolved
pygments/lexers/verifpal.py Outdated Show resolved Hide resolved
pygments/lexers/verifpal.py Outdated Show resolved Hide resolved
pygments/lexers/verifpal.py Outdated Show resolved Hide resolved
pygments/lexers/verifpal.py Outdated Show resolved Hide resolved
pygments/lexers/verifpal.py Outdated Show resolved Hide resolved
pygments/lexers/verifpal.py Outdated Show resolved Hide resolved
pygments/lexers/verifpal.py Outdated Show resolved Hide resolved
Co-authored-by: Jean Abou-Samra <jean@abou-samra.fr>
Copy link
Contributor

@jeanas jeanas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments and we should be good to go.

pygments/lexers/verifpal.py Outdated Show resolved Hide resolved
pygments/lexers/verifpal.py Outdated Show resolved Hide resolved
pygments/lexers/verifpal.py Outdated Show resolved Hide resolved
pygments/lexers/verifpal.py Outdated Show resolved Hide resolved
@jeanas
Copy link
Contributor

jeanas commented May 18, 2023

Also, there are CI failures.

pygments/lexers/verifpal.py Outdated Show resolved Hide resolved
@jvoisin
Copy link
Contributor Author

jvoisin commented May 20, 2023

I don't understand the linter error:

regexlint: commands[0]> regexlint pygments.lexers
/home/runner/work/pygments/pygments/pygments/lexers/verifpal.py: (VerifpalLexer:queries:pat#2) E108: Nested capture group other than the final one using bygroups
  '(((?:authentication|confidentiality|e...
    ^ here
regexlint: exit 1 (18.85 seconds) /home/runner/work/pygments/pygments> regexlint pygments.lexers pid=1778

@jeanas
Copy link
Contributor

jeanas commented May 20, 2023

Sorry, that was bad advice from me regarding bygroups() and words(). I forgot that words() introduces a capturing group. So the (words(..., prefix=r'(', suffix=r')( )'), bygroups(X, Y)) translated to (r'((...)( ))', bygroups(X, Y)), which doesn't give the expected result (the first 2 capturing groups are the outer one and the first inner one). I've fixed it.

@jeanas jeanas merged commit c3e1371 into pygments:master May 24, 2023
15 checks passed
@jeanas
Copy link
Contributor

jeanas commented May 24, 2023

Thanks!

@jvoisin jvoisin deleted the add_verifpal branch May 24, 2023 11:38
@Anteru Anteru added this to the 2.16.0 milestone Aug 5, 2023
@Anteru Anteru added the A-lexing area: changes to individual lexers label Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lexing area: changes to individual lexers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants