Add a STRRES lexer as well for Pygments
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4814 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
7688f97ed3
commit
cbda32117e
|
@ -12,5 +12,6 @@ setup(
|
||||||
entry_points = """
|
entry_points = """
|
||||||
[pygments.lexers]
|
[pygments.lexers]
|
||||||
wrflexer = warzone:WRFLexer
|
wrflexer = warzone:WRFLexer
|
||||||
|
strreslexer = warzone:STRRESLexer
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
|
@ -26,3 +26,26 @@ class WRFLexer(RegexLexer):
|
||||||
(r'\b.+?\b', Literal, '#pop'),
|
(r'\b.+?\b', Literal, '#pop'),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class STRRESLexer(RegexLexer):
|
||||||
|
name = 'STRRES'
|
||||||
|
aliases = ['strres']
|
||||||
|
filenames = ['*.txt']
|
||||||
|
mimetypes = ['text/x-strres']
|
||||||
|
|
||||||
|
tokens = {
|
||||||
|
'root': [
|
||||||
|
(r'/\*', Comment.Multiline, 'comment'),
|
||||||
|
(r'//.*?$', Comment.Singleline),
|
||||||
|
(r'"[^"]*"', String),
|
||||||
|
(r'[_a-zA-Z][-0-9_a-zA-Z]*', Literal),
|
||||||
|
(r'[ \t\n\x0d\x0a]+', Text),
|
||||||
|
(r'\(', Punctuation, '#push'),
|
||||||
|
(r'\)', Punctuation, '#pop'),
|
||||||
|
],
|
||||||
|
'comment': [
|
||||||
|
(r'[^*]+', Comment.Multiline),
|
||||||
|
(r'\*/', Comment.Multiline, '#pop'),
|
||||||
|
(r'\*[^/]', Comment.Multiline),
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue