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 lexer for the Savi language. #1863

Merged
merged 5 commits into from
Nov 21, 2021
Merged

Conversation

jemc
Copy link
Contributor

@jemc jemc commented Jul 17, 2021

This PR adds a lexer for the Savi programming language.

pygments/lexers/savi.py Outdated Show resolved Hide resolved
pygments/lexers/savi.py Outdated Show resolved Hide resolved
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.

(Note that I am not a maintainer, just someone lurking around and hoping that a preliminary review will help. You could also review my own PR ;-)

(Update: "preliminary review" was written before I reloaded the page and saw @Anteru had already left some comments.)

pygments/lexers/_mapping.py Show resolved Hide resolved
pygments/lexers/savi.py Outdated Show resolved Hide resolved
pygments/lexers/savi.py Outdated Show resolved Hide resolved
pygments/lexers/savi.py Outdated Show resolved Hide resolved
pygments/lexers/savi.py Outdated Show resolved Hide resolved
pygments/lexers/savi.py Outdated Show resolved Hide resolved
pygments/lexers/savi.py Outdated Show resolved Hide resolved
pygments/lexers/savi.py Outdated Show resolved Hide resolved
pygments/lexers/savi.py Outdated Show resolved Hide resolved
pygments/lexers/savi.py Outdated Show resolved Hide resolved
pygments/lexers/savi.py Outdated Show resolved Hide resolved
pygments/lexers/savi.py Outdated Show resolved Hide resolved
pygments/lexers/savi.py Outdated Show resolved Hide resolved
@jemc jemc requested a review from Anteru July 19, 2021 15:32
Copy link
Collaborator

@Anteru Anteru left a comment

Choose a reason for hiding this comment

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

This lexer matches colons as Tag or Punctuation. Is that by design? It seems quite confusing.

class SaviLexer(RegexLexer):
"""
For `Savi <https://github.com/savi-lang/savi>`_ source code.
"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

This needs a .. versionadded: 2.10 marker.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in 63c1f63

@jemc
Copy link
Contributor Author

jemc commented Aug 8, 2021

This lexer matches colons as Tag or Punctuation. Is that by design? It seems quite confusing.

Yes, it's by design. When a colon and immediately adjacent identifier are at the start of a line, together they form a tag that begins a declaration. Elsewhere the colon appears outside that one particular context, it is punctuation.

@Anteru Anteru merged commit 75a6077 into pygments:master Nov 21, 2021
@Anteru Anteru added this to the 2.11.0 milestone Nov 21, 2021
@Anteru
Copy link
Collaborator

Anteru commented Nov 21, 2021

Merged, thanks a lot!

@jemc jemc deleted the add/savi-lexer branch November 22, 2021 04:12
@jemc
Copy link
Contributor Author

jemc commented Dec 3, 2021

@Anteru - Thanks for merging this!

Is there another release coming up soon that could make this lexer available to downstream tools?

@Anteru
Copy link
Collaborator

Anteru commented Dec 4, 2021

There is, I'm just swamped right now :(

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