Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Alethe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
veriT
Alethe
Commits
5d255551
Commit
5d255551
authored
2 years ago
by
Hans-Jörg Schurr
Browse files
Options
Downloads
Patches
Plain Diff
Fix syntax highliging for new minted versions
parent
bab61d95
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2
Backport specification from my PhD thesis
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
spec/doc.tex
+3
-3
3 additions, 3 deletions
spec/doc.tex
spec/highlight.py
+24
-7
24 additions, 7 deletions
spec/highlight.py
with
27 additions
and
10 deletions
spec/doc.tex
+
3
−
3
View file @
5d255551
...
...
@@ -10,9 +10,9 @@
\usepackage
{
minted
}
\usemintedstyle
{
trac
}
% TODO: tweak hi
light
er
\newminted
[AletheVerb]
{
smtlib
2.py -x
}{}
\newmintinline
[inlineAlethe]
{
smtlib
2.py -x
}{}
\renewcommand
{
\MintedPygmentize
}{
./high
light
.py
}
\newminted
[AletheVerb]
{
smt
-
lib
}{}
\newmintinline
[inlineAlethe]
{
smt
-
lib
}{}
\usepackage
{
cite
}
\usepackage
{
url
}
...
...
This diff is collapsed.
Click to expand it.
spec/
smtlib2
.py
→
spec/
highlight
.py
100644 → 100755
+
24
−
7
View file @
5d255551
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# This is a thin wraper arround pygmentize that adds support for SMT-LIB/Alethe.
# More precicely: it parses the command line arguments and uses a custom
# SMT-LIB lexer if the user selects smt-lib as the language.
# This wrapper was made necessary by version 2.7 of minted: it started to
# quote command line arguments hended to pygmentize and thereby made the old
# tick to use "smtlib2.py -x" as the language unworkable.
import
re
import
argparse
import
sys
from
pygments.
lexer
import
Lexer
,
RegexLexer
,
bygroups
,
do_insertions
,
\
default
,
include
import
pygments.
cmdline
as
_cmdline
from
pygments.lexer
import
RegexLexer
from
pygments.token
import
Text
,
Comment
,
Operator
,
Keyword
,
Name
,
String
,
\
Number
,
Punctuation
,
Generic
from
pygments
import
unistring
as
uni
__all__
=
[
'
Smt2Lexer
'
]
Number
,
Punctuation
def
main
(
args
):
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'
-l
'
,
dest
=
'
lexer
'
,
type
=
str
)
opts
,
rest
=
parser
.
parse_known_args
(
args
[
1
:])
if
opts
.
lexer
==
'
smt-lib
'
:
args
=
[
__file__
,
'
-l
'
,
__file__
+
'
:SMTLibLexer
'
,
'
-x
'
,
*
rest
]
_cmdline
.
main
(
args
)
line_re
=
re
.
compile
(
'
.*?
\n
'
)
class
Custom
Lexer
(
RegexLexer
):
class
SMTLib
Lexer
(
RegexLexer
):
"""
A SMT-Lib 2 parser
"""
...
...
@@ -117,3 +131,6 @@ class CustomLexer(RegexLexer):
(
r
'
[^()]+
'
,
Comment
),
],
}
if
__name__
==
'
__main__
'
:
main
(
sys
.
argv
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment