summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhhsprings <xwhhsprings@gmail.com>2015-11-07 22:28:41 +0900
committerhhsprings <xwhhsprings@gmail.com>2015-11-07 22:28:41 +0900
commit5dd622f3a8530f87332891f5e41d5598ef7869e4 (patch)
tree7ede273f83502463cdbb598ab51f3d820cdac974
parent56e90ee69d37431d9b74edb4e7f6c6b751c61ffd (diff)
downloadpygments-5dd622f3a8530f87332891f5e41d5598ef7869e4.tar.gz
See `#1164 <https://bitbucket.org/birkenfeld/pygments-main/issues/1164/linter-to-check-for-single-character#comment-23138389>`_.
Before: 61676 bytes, 107.8900 [ms] / 0.001749 [ms/byte] 68185 bytes, 134.8400 [ms] / 0.001978 [ms/byte] 61676 bytes, 107.4600 [ms] / 0.001742 [ms/byte] 68185 bytes, 144.8300 [ms] / 0.002124 [ms/byte] 61676 bytes, 108.3800 [ms] / 0.001757 [ms/byte] 68185 bytes, 143.5400 [ms] / 0.002105 [ms/byte] After: 61676 bytes, 82.1200 [ms] / 0.001331 [ms/byte] 68185 bytes, 105.8000 [ms] / 0.001552 [ms/byte] 61676 bytes, 77.1700 [ms] / 0.001251 [ms/byte] 68185 bytes, 91.2400 [ms] / 0.001338 [ms/byte] 61676 bytes, 76.6100 [ms] / 0.001242 [ms/byte] 68185 bytes, 95.7300 [ms] / 0.001404 [ms/byte] x1.5 faster?
-rw-r--r--pygments/lexers/configs.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/pygments/lexers/configs.py b/pygments/lexers/configs.py
index 8a83b433..f6f280ee 100644
--- a/pygments/lexers/configs.py
+++ b/pygments/lexers/configs.py
@@ -660,6 +660,7 @@ class TermcapLexer(RegexLexer):
'data': [
(r'\\072', Literal),
(r':', Punctuation, '#pop'),
+ (r'[^:\\]+', Literal), # for performance
(r'.', Literal),
],
}
@@ -706,6 +707,7 @@ class TerminfoLexer(RegexLexer):
'data': [
(r'\\[,\\]', Literal),
(r'(,)([ \t]*)', bygroups(Punctuation, Text), '#pop'),
+ (r'[^\\,]+', Literal), # for performance
(r'.', Literal),
],
}