This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
26
unikernel/duniverse/dune_/doc/exts/opam_lexer.py
Normal file
26
unikernel/duniverse/dune_/doc/exts/opam_lexer.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
from pygments.lexer import RegexLexer
|
||||
from pygments.token import (
|
||||
Keyword,
|
||||
Number,
|
||||
Punctuation,
|
||||
String,
|
||||
Text,
|
||||
Whitespace,
|
||||
)
|
||||
|
||||
|
||||
ident = r"[-\w]+"
|
||||
|
||||
|
||||
class OpamLexer(RegexLexer):
|
||||
name = "opam"
|
||||
tokens = {
|
||||
"root": [
|
||||
(r"\d\.\d", Number),
|
||||
(r"^" + ident + ":", Keyword),
|
||||
(ident, Text),
|
||||
(r"[\[\]{}>=]", Punctuation),
|
||||
(r"\s+", Whitespace),
|
||||
(r'"[^\"]*"', String),
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue