diff options
author | Tim Hatch <tim@timhatch.com> | 2014-10-15 12:59:55 -0700 |
---|---|---|
committer | Tim Hatch <tim@timhatch.com> | 2014-10-15 12:59:55 -0700 |
commit | b51bfe6f6c9b69605117ef01bfaeab71e4dabf37 (patch) | |
tree | 2493d23c58030e3a708830b312691eccec2b684e | |
parent | 10be9bec8a7969a40d4fa3483b8317e0131b1715 (diff) | |
parent | d2fb0a7db3b59040820b4e839acb1d5b529ebe0f (diff) | |
download | pygments-b51bfe6f6c9b69605117ef01bfaeab71e4dabf37.tar.gz |
Merge with -main
-rw-r--r-- | pygments/formatters/other.py | 4 | ||||
-rw-r--r-- | pygments/lexers/dotnet.py | 30 | ||||
-rw-r--r-- | pygments/lexers/javascript.py | 11 | ||||
-rw-r--r-- | pygments/lexers/jvm.py | 6 |
4 files changed, 24 insertions, 27 deletions
diff --git a/pygments/formatters/other.py b/pygments/formatters/other.py index d8e5f4f7..6100f70b 100644 --- a/pygments/formatters/other.py +++ b/pygments/formatters/other.py @@ -136,10 +136,8 @@ class TestcaseFormatter(Formatter): def __init__(self, **options): Formatter.__init__(self, **options) - #if self.encoding != 'utf-8': - # print >>sys.stderr, "NOTICE: Forcing encoding to utf-8, as all Pygments source is" if self.encoding is not None and self.encoding != 'utf-8': - raise ValueError("Only None and utf-u are allowed encodings.") + raise ValueError("Only None and utf-8 are allowed encodings.") def format(self, tokensource, outfile): indentation = ' ' * 12 diff --git a/pygments/lexers/dotnet.py b/pygments/lexers/dotnet.py index 204b4a71..0b395a40 100644 --- a/pygments/lexers/dotnet.py +++ b/pygments/lexers/dotnet.py @@ -54,14 +54,14 @@ class CSharpLexer(RegexLexer): flags = re.MULTILINE | re.DOTALL | re.UNICODE - # for the range of allowed unicode characters in identifiers, - # see http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf + # for the range of allowed unicode characters in identifiers, see + # http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf levels = { 'none': '@?[_a-zA-Z]\w*', - 'basic': ('@?[_' + uni.Lu + uni.Ll + uni.Lt + uni.Lm + uni.Nl + ']' + - '[' + uni.Lu + uni.Ll + uni.Lt + uni.Lm + uni.Nl + - uni.Nd + uni.Pc + uni.Cf + uni.Mn + uni.Mc + ']*'), + 'basic': ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' + + '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc', + 'Cf', 'Mn', 'Mc') + ']*'), 'full': ('@?(?:_|[^' + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + '])' + '[^' + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl', @@ -169,16 +169,16 @@ class NemerleLexer(RegexLexer): # for the range of allowed unicode characters in identifiers, see # http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf - levels = dict( - none='@?[_a-zA-Z]\w*', - basic=('@?[_' + uni.Lu + uni.Ll + uni.Lt + uni.Lm + uni.Nl + ']' + - '[' + uni.Lu + uni.Ll + uni.Lt + uni.Lm + uni.Nl + - uni.Nd + uni.Pc + uni.Cf + uni.Mn + uni.Mc + ']*'), - full=('@?(?:_|[^' + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', - 'Nl') + '])' - + '[^' + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl', - 'Nd', 'Pc', 'Cf', 'Mn', 'Mc') + ']*'), - ) + levels = { + 'none': '@?[_a-zA-Z]\w*', + 'basic': ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' + + '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc', + 'Cf', 'Mn', 'Mc') + ']*'), + 'full': ('@?(?:_|[^' + + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + '])' + + '[^' + uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl', + 'Nd', 'Pc', 'Cf', 'Mn', 'Mc') + ']*'), + } tokens = {} token_variants = True diff --git a/pygments/lexers/javascript.py b/pygments/lexers/javascript.py index 481243ef..57870009 100644 --- a/pygments/lexers/javascript.py +++ b/pygments/lexers/javascript.py @@ -22,12 +22,11 @@ __all__ = ['JavascriptLexer', 'KalLexer', 'LiveScriptLexer', 'DartLexer', 'TypeScriptLexer', 'LassoLexer', 'ObjectiveJLexer', 'CoffeeScriptLexer', 'MaskLexer'] - -JS_IDENT_START = ('(?:[$_' + uni.Lu + uni.Ll + uni.Lt + uni.Lm + uni.Lo + uni.Nl - + ']|\\\\u[a-fA-F0-9]{4})') -JS_IDENT_PART = ('(?:[$_' + uni.Lu + uni.Ll + uni.Lt + uni.Lm + uni.Lo + uni.Nl - + uni.Mn + uni.Mc + uni.Nd + uni.Pc - + u'\u200c\u200d]|\\\\u[a-fA-F0-9]{4})') +JS_IDENT_START = ('(?:[$_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl') + + ']|\\\\u[a-fA-F0-9]{4})') +JS_IDENT_PART = ('(?:[$_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl', + 'Mn', 'Mc', 'Nd', 'Pc') + + u'\u200c\u200d]|\\\\u[a-fA-F0-9]{4})') JS_IDENT = JS_IDENT_START + '(?:' + JS_IDENT_PART + ')*' diff --git a/pygments/lexers/jvm.py b/pygments/lexers/jvm.py index 898cf415..df54e714 100644 --- a/pygments/lexers/jvm.py +++ b/pygments/lexers/jvm.py @@ -999,9 +999,9 @@ class KotlinLexer(RegexLexer): flags = re.MULTILINE | re.DOTALL | re.UNICODE - kt_name = ('@?[_' + uni.Lu + uni.Ll + uni.Lt + uni.Lm + uni.Nl + ']' + - '[' + uni.Lu + uni.Ll + uni.Lt + uni.Lm + uni.Nl + uni.Nd + - uni.Pc + uni.Cf + uni.Mn + uni.Mc + ']*') + kt_name = ('@?[_' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl') + ']' + + '[' + uni.combine('Lu', 'Ll', 'Lt', 'Lm', 'Nl', 'Nd', 'Pc', 'Cf', + 'Mn', 'Mc') + ']*') kt_id = '(' + kt_name + '|`' + kt_name + '`)' tokens = { |