Skip to content

Conversation

@lmarzen
Copy link
Contributor

@lmarzen lmarzen commented Jan 2, 2024

This pull request adds a lexer for Promela. (https://spinroot.com/spin/whatispin.html)

Promela (Process Meta Language) is a C-like language used by SPIN to formally model software and hardware systems. SPIN (Simple Promela Interpreter) was originally developed in the 1980s at Bell Labs and since 1991 has been open-source and is a popular formal methods tool.

Pygments already supports other popular formal methods languages, including Isabelle, Coq, and NuSmv. Promela would be a fitting addition.

I have not included test snippets since PromelaLexer is derived from CLexer, though I have tested that it produces correct highlighting on a few of my own Promela files. Edit: I added snippets and examplefiles and ran tox -e check and tox -e mapfiles which both succeeded.

@cmarqu
Copy link
Contributor

cmarqu commented Jan 9, 2024

(Another potential pygments contributor here...)
You might want to add a line to the CHANGES file also.

@jeanas
Copy link
Contributor

jeanas commented Jan 13, 2024

You might want to add a line to the CHANGES file also.

Well, we (maintainers) update it ourselves; we don't ask contributors to do this. (But thank you for taking a look at the PR.)

Co-authored-by: Jean Abou-Samra <[email protected]>
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.

Looks OK. Since it seems this language can contain embedded C, shouldn't 'types' and 'keywords' have an inherit at the end to also highlight C types/keywords?

@lmarzen
Copy link
Contributor Author

lmarzen commented Jan 13, 2024

Promela does not have all the types and keywords of C. Only the ones I specified, so inherit, was initentially left out.

@jeanas jeanas merged commit 6b7e401 into pygments:master Jan 23, 2024
@jeanas
Copy link
Contributor

jeanas commented Jan 23, 2024

Sorry for the delay. Thanks for your contribution!

@Anteru Anteru added this to the 2.18.0 milestone Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants