Skip to content

Add a lexer for Verifpal#2430

Merged
jeanas merged 5 commits intopygments:masterfrom
jvoisin:add_verifpal
May 24, 2023
Merged

Add a lexer for Verifpal#2430
jeanas merged 5 commits intopygments:masterfrom
jvoisin:add_verifpal

Conversation

@jvoisin
Copy link
Copy Markdown
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 :)

Comment thread pygments/lexers/verifpal.py Outdated
Comment thread pygments/lexers/verifpal.py Outdated
Comment thread pygments/lexers/verifpal.py Outdated
Comment thread pygments/lexers/verifpal.py Outdated
Comment thread pygments/lexers/verifpal.py Outdated
Comment thread pygments/lexers/verifpal.py Outdated
Comment thread pygments/lexers/verifpal.py Outdated
Comment thread pygments/lexers/verifpal.py Outdated
Comment thread pygments/lexers/verifpal.py Outdated
Co-authored-by: Jean Abou-Samra <jean@abou-samra.fr>
Copy link
Copy Markdown
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.

Comment thread pygments/lexers/verifpal.py Outdated
Comment thread pygments/lexers/verifpal.py Outdated
Comment thread pygments/lexers/verifpal.py Outdated
Comment thread pygments/lexers/verifpal.py Outdated
@jeanas
Copy link
Copy Markdown
Contributor

jeanas commented May 18, 2023

Also, there are CI failures.

Comment thread pygments/lexers/verifpal.py Outdated
@jvoisin
Copy link
Copy Markdown
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
Copy Markdown
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
@jeanas
Copy link
Copy Markdown
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.

3 participants