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 Typographic Number Theory lexer #1414

Merged
merged 7 commits into from
Apr 10, 2020
Merged

Add Typographic Number Theory lexer #1414

merged 7 commits into from
Apr 10, 2020

Conversation

Kenny2github
Copy link
Contributor

Typographic Number Theory, or TNT was introduced in Gödel, Escher, Bach by Douglas R. Hofstadter. This pull request adds syntax highlighting for TNT in .tnt files.

Anteru and others added 7 commits March 13, 2020 01:51
This is slightly different from the code posted inside the issue:
* Use finally to close the registry key no matter what
* Don't use break, but return directly on the first hit
* Fix an issue raised in the review -- don't raise None no matter what.
* Remove a few variables to make the control flow easier to understand
SQL:2011 introduced support for temporal databases[1] via new keywords to
create and manage temporal tables. This patchset adds these new keywords to
the sql lexer.

One concrete example of these feature is the temporal tables support in
MariaDB[2]. As evident from the code listing on that page, the syntax
highlighting for these keywords is not as widespread as expected (I wouldn't
be surprised if code listing on that page ultimately use pygments for syntax
highlighting !)

[1] https://en.wikipedia.org/wiki/SQL:2011
[2] https://mariadb.com/kb/en/temporal-data-tables/
Originally tried to use RegexLexer, but the
structure of TNT is too rigid for it to handle.
Went with a direct parser instead.
* Fixed: Not capturing all whitespace
* Fixed: Invalid TNT in example file
@Kenny2github
Copy link
Contributor Author

Apologies for rebase detritus!

@Anteru Anteru merged commit 621e9e2 into pygments:master Apr 10, 2020
@Anteru
Copy link
Collaborator

Anteru commented Apr 10, 2020

Merged, thanks for the contribution!

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