summaryrefslogtreecommitdiff
path: root/pygments/lexers
diff options
context:
space:
mode:
authorAnteru <bitbucket@ca.sh13.net>2018-11-24 16:37:08 +0000
committerAnteru <bitbucket@ca.sh13.net>2018-11-24 16:37:08 +0000
commit1bfff44f8619abe64a30cfd07241a7ee4e97a191 (patch)
tree3aed608195db4dbd33123a750cbbfe20f29e2df5 /pygments/lexers
parentb909c279a4cf4a93c5244e2c3046d769ba737dc0 (diff)
parent058fcfb0ff9bfeea8b9c29196a952e58ccf3e188 (diff)
downloadpygments-1bfff44f8619abe64a30cfd07241a7ee4e97a191.tar.gz
Merged in hroncok/pygments-main/py37 (pull request #772)
PEP 479: Raising StopIteration from a generator is now an error Approved-by: Anteru <bitbucket@ca.sh13.net>
Diffstat (limited to 'pygments/lexers')
-rw-r--r--pygments/lexers/_lua_builtins.py2
-rw-r--r--pygments/lexers/_mapping.py2
-rw-r--r--pygments/lexers/ampl.py4
-rw-r--r--pygments/lexers/css.py23
-rw-r--r--pygments/lexers/jvm.py2
-rw-r--r--pygments/lexers/rust.py2
6 files changed, 19 insertions, 16 deletions
diff --git a/pygments/lexers/_lua_builtins.py b/pygments/lexers/_lua_builtins.py
index c60bf5a2..0561725d 100644
--- a/pygments/lexers/_lua_builtins.py
+++ b/pygments/lexers/_lua_builtins.py
@@ -288,7 +288,7 @@ if __name__ == '__main__': # pragma: no cover
print('>> %s' % full_function_name)
m = get_function_module(full_function_name)
modules.setdefault(m, []).append(full_function_name)
- modules = {k: tuple(v) for k, v in modules.iteritems()}
+ modules = dict((k, tuple(v)) for k, v in modules.iteritems())
regenerate(__file__, modules)
diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py
index b48ee1d1..050373aa 100644
--- a/pygments/lexers/_mapping.py
+++ b/pygments/lexers/_mapping.py
@@ -367,7 +367,7 @@ LEXERS = {
'RtsLexer': ('pygments.lexers.trafficscript', 'TrafficScript', ('rts', 'trafficscript'), ('*.rts',), ()),
'RubyConsoleLexer': ('pygments.lexers.ruby', 'Ruby irb session', ('rbcon', 'irb'), (), ('text/x-ruby-shellsession',)),
'RubyLexer': ('pygments.lexers.ruby', 'Ruby', ('rb', 'ruby', 'duby'), ('*.rb', '*.rbw', 'Rakefile', '*.rake', '*.gemspec', '*.rbx', '*.duby', 'Gemfile'), ('text/x-ruby', 'application/x-ruby')),
- 'RustLexer': ('pygments.lexers.rust', 'Rust', ('rust',), ('*.rs', '*.rs.in'), ('text/rust',)),
+ 'RustLexer': ('pygments.lexers.rust', 'Rust', ('rust', 'rs'), ('*.rs', '*.rs.in'), ('text/rust',)),
'SASLexer': ('pygments.lexers.sas', 'SAS', ('sas',), ('*.SAS', '*.sas'), ('text/x-sas', 'text/sas', 'application/x-sas')),
'SLexer': ('pygments.lexers.r', 'S', ('splus', 's', 'r'), ('*.S', '*.R', '.Rhistory', '.Rprofile', '.Renviron'), ('text/S-plus', 'text/S', 'text/x-r-source', 'text/x-r', 'text/x-R', 'text/x-r-history', 'text/x-r-profile')),
'SMLLexer': ('pygments.lexers.ml', 'Standard ML', ('sml',), ('*.sml', '*.sig', '*.fun'), ('text/x-standardml', 'application/x-standardml')),
diff --git a/pygments/lexers/ampl.py b/pygments/lexers/ampl.py
index d439cb19..638d025d 100644
--- a/pygments/lexers/ampl.py
+++ b/pygments/lexers/ampl.py
@@ -3,7 +3,7 @@
pygments.lexers.ampl
~~~~~~~~~~~~~~~~~~~~
- Lexers for the ampl language. <http://ampl.com/>
+ Lexers for the AMPL language.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
@@ -18,7 +18,7 @@ __all__ = ['AmplLexer']
class AmplLexer(RegexLexer):
"""
- For AMPL source code.
+ For `AMPL <http://ampl.com/>`_ source code.
.. versionadded:: 2.2
"""
diff --git a/pygments/lexers/css.py b/pygments/lexers/css.py
index 29d83707..ce97730e 100644
--- a/pygments/lexers/css.py
+++ b/pygments/lexers/css.py
@@ -125,7 +125,7 @@ _css_properties = (
'wrap-flow', 'wrap-inside', 'wrap-through', 'writing-mode', 'z-index',
)
-# List of keyword values obtained from:
+# List of keyword values obtained from:
# http://cssvalues.com/
_keyword_values = (
'absolute', 'alias', 'all', 'all-petite-caps', 'all-scroll',
@@ -263,7 +263,7 @@ _time_units = (
's', 'ms',
)
_all_units = _angle_units + _frequency_units + _length_units + \
- _resolution_units + _time_units
+ _resolution_units + _time_units
class CssLexer(RegexLexer):
@@ -322,16 +322,18 @@ class CssLexer(RegexLexer):
include('urls'),
(r'('+r'|'.join(_functional_notation_keyword_values)+r')(\()',
bygroups(Name.Builtin, Punctuation), 'function-start'),
- (r'([a-zA-Z_][\w-]+)(\()', bygroups(Name.Function, Punctuation), 'function-start'),
+ (r'([a-zA-Z_][\w-]+)(\()',
+ bygroups(Name.Function, Punctuation), 'function-start'),
(words(_keyword_values, suffix=r'\b'), Keyword.Constant),
(words(_other_keyword_values, suffix=r'\b'), Keyword.Constant),
(words(_color_keywords, suffix=r'\b'), Keyword.Constant),
- (words(_css_properties, suffix=r'\b'), Keyword), # for transition-property etc.
+ # for transition-property etc.
+ (words(_css_properties, suffix=r'\b'), Keyword),
(r'\!important', Comment.Preproc),
(r'/\*(?:.|\n)*?\*/', Comment),
include('numeric-values'),
-
+
(r'[~^*!%&<>|+=@:./?-]+', Operator),
(r'[\[\](),]+', Punctuation),
(r'"(\\\\|\\"|[^"])*"', String.Double),
@@ -351,7 +353,8 @@ class CssLexer(RegexLexer):
# function-start may be entered recursively
(r'(' + r'|'.join(_functional_notation_keyword_values) + r')(\()',
bygroups(Name.Builtin, Punctuation), 'function-start'),
- (r'([a-zA-Z_][\w-]+)(\()', bygroups(Name.Function, Punctuation), 'function-start'),
+ (r'([a-zA-Z_][\w-]+)(\()',
+ bygroups(Name.Function, Punctuation), 'function-start'),
(r'/\*(?:.|\n)*?\*/', Comment),
include('numeric-values'),
@@ -373,8 +376,8 @@ class CssLexer(RegexLexer):
'numeric-values': [
(r'\#[a-zA-Z0-9]{1,6}', Number.Hex),
(r'[+\-]?[0-9]*[.][0-9]+', Number.Float, 'numeric-end'),
- (r'[+\-]?[0-9]+', Number.Integer, 'numeric-end'),
- ],
+ (r'[+\-]?[0-9]+', Number.Integer, 'numeric-end'),
+ ],
'numeric-end': [
(words(_all_units, suffix=r'\b'), Keyword.Type),
(r'%', Keyword.Type),
@@ -466,9 +469,9 @@ common_sass_tokens = {
],
'string-single': [
- (r"(\\.|#(?=[^\n{])|[^\n'#])+", String.Double),
+ (r"(\\.|#(?=[^\n{])|[^\n'#])+", String.Single),
(r'#\{', String.Interpol, 'interpolation'),
- (r"'", String.Double, '#pop'),
+ (r"'", String.Single, '#pop'),
],
'string-url': [
diff --git a/pygments/lexers/jvm.py b/pygments/lexers/jvm.py
index f4392839..ccff41c1 100644
--- a/pygments/lexers/jvm.py
+++ b/pygments/lexers/jvm.py
@@ -801,7 +801,7 @@ class ClojureLexer(RegexLexer):
# TODO / should divide keywords/symbols into namespace/rest
# but that's hard, so just pretend / is part of the name
- valid_name = r'(?!#)[\w!$%*+<=>?/.#-]+'
+ valid_name = r'(?!#)[\w!$%*+<=>?/.#|-]+'
tokens = {
'root': [
diff --git a/pygments/lexers/rust.py b/pygments/lexers/rust.py
index 6914f54d..10097fba 100644
--- a/pygments/lexers/rust.py
+++ b/pygments/lexers/rust.py
@@ -24,7 +24,7 @@ class RustLexer(RegexLexer):
"""
name = 'Rust'
filenames = ['*.rs', '*.rs.in']
- aliases = ['rust']
+ aliases = ['rust', 'rs']
mimetypes = ['text/rust']
keyword_types = (