summaryrefslogtreecommitdiff
path: root/pygments/lexers/typoscript.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/lexers/typoscript.py')
-rw-r--r--pygments/lexers/typoscript.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/pygments/lexers/typoscript.py b/pygments/lexers/typoscript.py
index 407847ed..6e1c3155 100644
--- a/pygments/lexers/typoscript.py
+++ b/pygments/lexers/typoscript.py
@@ -14,17 +14,15 @@
`TypoScriptHtmlDataLexer`
Lexer that highlights markers, constants and registers within html tags.
- :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
+ :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, using
-from pygments.token import Keyword, Text, Comment, Name, String, Number, \
+from pygments.token import Text, Comment, Name, String, Number, \
Operator, Punctuation
-from pygments.lexer import DelegatingLexer
-from pygments.lexers.web import HtmlLexer, CssLexer
__all__ = ['TypoScriptLexer', 'TypoScriptCssDataLexer', 'TypoScriptHtmlDataLexer']
@@ -115,6 +113,9 @@ class TypoScriptLexer(RegexLexer):
flags = re.DOTALL | re.MULTILINE
+ # Slightly higher than TypeScript (which is 0).
+ priority = 0.0
+
tokens = {
'root': [
include('comment'),
@@ -131,7 +132,7 @@ class TypoScriptLexer(RegexLexer):
],
'keywords': [
# Conditions
- (r'(\[)(?i)(browser|compatVersion|dayofmonth|dayofweek|dayofyear|'
+ (r'(?i)(\[)(browser|compatVersion|dayofmonth|dayofweek|dayofyear|'
r'device|ELSE|END|GLOBAL|globalString|globalVar|hostname|hour|IP|'
r'language|loginUser|loginuser|minute|month|page|PIDinRootline|'
r'PIDupinRootline|system|treeLevel|useragent|userFunc|usergroup|'
@@ -168,14 +169,14 @@ class TypoScriptLexer(RegexLexer):
'whitespace': [
(r'\s+', Text),
],
- 'html':[
+ 'html': [
(r'<\S[^\n>]*>', using(TypoScriptHtmlDataLexer)),
(r'&[^;\n]*;', String),
- (r'(_CSS_DEFAULT_STYLE)(\s*)(\()(?s)(.*(?=\n\)))',
- bygroups(Name.Class, Text, String.Symbol, using(TypoScriptCssDataLexer))),
+ (r'(?s)(_CSS_DEFAULT_STYLE)(\s*)(\()(.*(?=\n\)))',
+ bygroups(Name.Class, Text, String.Symbol, using(TypoScriptCssDataLexer))),
],
'literal': [
- (r'0x[0-9A-Fa-f]+t?',Number.Hex),
+ (r'0x[0-9A-Fa-f]+t?', Number.Hex),
# (r'[0-9]*\.[0-9]+([eE][0-9]+)?[fd]?\s*(?:[^=])', Number.Float),
(r'[0-9]+', Number.Integer),
(r'(###\w+###)', Name.Constant),