Added pygments lexer
parent
fab7d8916e
commit
a92ee8c187
|
@ -0,0 +1,20 @@
|
|||
from pygments.lexer import RegexLexer
|
||||
from pygments.token import Whitespace, Comment, Keyword, Operator, Number, Name, String, Generic
|
||||
|
||||
class VSLLexer(RegexLexer):
|
||||
name = "VSL"
|
||||
aliases = ["vsl"]
|
||||
filenames = ["*.vsl"]
|
||||
|
||||
tokens = {
|
||||
"root": [
|
||||
(r"[\ \t\v\r\n]+", Whitespace),
|
||||
(r"\/\/[^\n]+", Comment),
|
||||
(r"func|print|return|continue|if|then|else|while|do|begin|end|var", Keyword),
|
||||
(r"\^|\||:|=|\+|-|\*|\/|<|>|&", Operator),
|
||||
(r"[0-9]+", Number.Integer),
|
||||
(r"[A-Za-z_][0-9A-Za-z_]*", Name),
|
||||
(r"\"([^\"\n]|\\\")*\"", String),
|
||||
(r".", Generic),
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue