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

Merge lexer support for ANSI-standard MUMPS #2089

Open
wants to merge 259 commits into
base: master
Choose a base branch
from

Conversation

saint-erk
Copy link

Creates a lexer, lexer tests, and example files for the MUMPS programming language, using the ANSI M standard.

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 preliminary review, didn't get to the core parts as this is quite large. I think that by refactoring the lexer you will be able to simplify it enormously.

pygments/lexers/mumps.py Outdated Show resolved Hide resolved
pygments/lexers/mumps.py Outdated Show resolved Hide resolved
pygments/lexers/mumps.py Outdated Show resolved Hide resolved
pygments/lexers/mumps.py Show resolved Hide resolved
pygments/lexers/mumps.py Outdated Show resolved Hide resolved
pygments/lexers/mumps.py Show resolved Hide resolved
tests/test_mumps.py Outdated Show resolved Hide resolved
@jeanas jeanas added the update needed Waiting for an update from the PR/issue creator label Mar 21, 2022
@jeanas jeanas removed the update needed Waiting for an update from the PR/issue creator label Jun 28, 2022
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.

A few more comments and I think we're good to go.

pygments/lexers/mumps.py Outdated Show resolved Hide resolved
Comment on lines +56 to +59
if re.search(r'^[%A-Za-z][A-Za-z0-9]* ;', text):
return 0.3
if re.search(r'^[%A-Za-z][A-Za-z0-9]*\n', text):
return 0.1
Copy link
Contributor

Choose a reason for hiding this comment

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

Aren't there some more specific ways to recognize MUMPS? There patterns are very unspecific, it seems to me that they will trigger on many languages ...

Copy link
Contributor

Choose a reason for hiding this comment

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

This is still an issue.

Copy link
Author

Choose a reason for hiding this comment

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

True, I will work on finding some patterns that have better matching. The joys of old terse languages that existed on dedicated machines...

tests/examplefiles/conftest.py Outdated Show resolved Hide resolved
pygments/lexers/mumps.py Outdated Show resolved Hide resolved
tests/snippets/conftest.py Outdated Show resolved Hide resolved
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.

None yet

3 participants