summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauricio Caceres Bravo <mauricio.caceres.bravo@gmail.com>2019-02-19 11:40:43 -0500
committerMauricio Caceres Bravo <mauricio.caceres.bravo@gmail.com>2019-02-19 11:40:43 -0500
commit4b9174ce07c5365424ed25c223e484fc35427dec (patch)
tree63dd7bd8652cab270ce6a9d6c50ca224f66c60f3
parent62ff49874c8a405fc24a83cb6611e8a5cf818bd5 (diff)
downloadpygments-4b9174ce07c5365424ed25c223e484fc35427dec.tar.gz
Fix StataLexer format highlight error (change Name.Format to Name.Other)
StataLexer defined Name.Format for variable and print format highlighting; Name.Format is not a built-in token, which caused issues downstream in certain applications (e.g. [here](https://github.com/kylebarron/stata_kernel/issues/295)). This commit changes Name.Format to Name.Other.
-rw-r--r--pygments/lexers/stata.py8
-rw-r--r--pygments/styles/stata_dark.py2
-rw-r--r--pygments/styles/stata_light.py2
3 files changed, 6 insertions, 6 deletions
diff --git a/pygments/lexers/stata.py b/pygments/lexers/stata.py
index 8955a05c..9566d12a 100644
--- a/pygments/lexers/stata.py
+++ b/pygments/lexers/stata.py
@@ -163,9 +163,9 @@ class StataLexer(RegexLexer):
],
# Stata formats
'format': [
- (r'%-?\d{1,2}(\.\d{1,2})?[gfe]c?', Name.Format),
- (r'%(21x|16H|16L|8H|8L)', Name.Format),
- (r'%-?(tc|tC|td|tw|tm|tq|th|ty|tg).{0,32}', Name.Format),
- (r'%[-~]?\d{1,4}s', Name.Format),
+ (r'%-?\d{1,2}(\.\d{1,2})?[gfe]c?', Name.Other),
+ (r'%(21x|16H|16L|8H|8L)', Name.Other),
+ (r'%-?(tc|tC|td|tw|tm|tq|th|ty|tg)\S{0,32}', Name.Other),
+ (r'%[-~]?\d{1,4}s', Name.Other),
]
}
diff --git a/pygments/styles/stata_dark.py b/pygments/styles/stata_dark.py
index 7610ba0f..851a9a8d 100644
--- a/pygments/styles/stata_dark.py
+++ b/pygments/styles/stata_dark.py
@@ -31,7 +31,7 @@ class StataDarkStyle(Style):
Number: '#4FB8CC',
Operator: '',
Name.Function: '#6a6aff',
- Name.Format: '#e2828e',
+ Name.Other: '#e2828e',
Keyword: 'bold #7686bb',
Keyword.Constant: '',
Comment: 'italic #777777',
diff --git a/pygments/styles/stata_light.py b/pygments/styles/stata_light.py
index 86802ef7..fcca85e5 100644
--- a/pygments/styles/stata_light.py
+++ b/pygments/styles/stata_light.py
@@ -30,7 +30,7 @@ class StataLightStyle(Style):
Number: '#2c2cff',
Operator: '',
Name.Function: '#2c2cff',
- Name.Format: '#be646c',
+ Name.Other: '#be646c',
Keyword: 'bold #353580',
Keyword.Constant: '',
Comment: 'italic #008800',