diff options
-rw-r--r-- | pygments/lexers/c_cpp.py | 2 | ||||
-rw-r--r-- | pygments/lexers/graphics.py | 2 | ||||
-rw-r--r-- | pygments/lexers/haskell.py | 5 | ||||
-rw-r--r-- | pygments/lexers/int_fiction.py | 28 | ||||
-rw-r--r-- | pygments/lexers/javascript.py | 2 | ||||
-rw-r--r-- | pygments/lexers/modeling.py | 2 | ||||
-rw-r--r-- | pygments/lexers/objective.py | 6 | ||||
-rw-r--r-- | pygments/lexers/parsers.py | 6 | ||||
-rw-r--r-- | pygments/lexers/webmisc.py | 2 |
9 files changed, 28 insertions, 27 deletions
diff --git a/pygments/lexers/c_cpp.py b/pygments/lexers/c_cpp.py index 86927b0e..2e12ec4b 100644 --- a/pygments/lexers/c_cpp.py +++ b/pygments/lexers/c_cpp.py @@ -87,7 +87,7 @@ class CFamilyLexer(RegexLexer): (r'((?:[\w*\s])+?(?:\s|[*]))' # return arguments r'([a-zA-Z_]\w*)' # method name r'(\s*\([^;]*?\))' # signature - r'(' + _ws + r')?({)', + r'(' + _ws + r')?(\{)', bygroups(using(this), Name.Function, using(this), using(this), Punctuation), 'function'), diff --git a/pygments/lexers/graphics.py b/pygments/lexers/graphics.py index 4ed12705..7cf1c5b7 100644 --- a/pygments/lexers/graphics.py +++ b/pygments/lexers/graphics.py @@ -240,7 +240,7 @@ class AsymptoteLexer(RegexLexer): (r'((?:[\w*\s])+?(?:\s|\*))' # return arguments r'([a-zA-Z_]\w*)' # method name r'(\s*\([^;]*?\))' # signature - r'(' + _ws + r')({)', + r'(' + _ws + r')(\{)', bygroups(using(this), Name.Function, using(this), using(this), Punctuation), 'function'), diff --git a/pygments/lexers/haskell.py b/pygments/lexers/haskell.py index 9bcbc406..48980e12 100644 --- a/pygments/lexers/haskell.py +++ b/pygments/lexers/haskell.py @@ -414,8 +414,9 @@ class CryptolLexer(RegexLexer): (r'\s+', Text), (r'[A-Z][a-zA-Z0-9_]*', Keyword.Type), (r'(_[\w\']+|[a-z][\w\']*)', Name.Function), - (r'--(?![!#$%&*+./<=>?@\^|_~:\\]).*?$', Comment.Single), - (r'{-', Comment.Multiline, 'comment'), + # TODO: these don't match the comments in docs, remove. + #(r'--(?![!#$%&*+./<=>?@\^|_~:\\]).*?$', Comment.Single), + #(r'{-', Comment.Multiline, 'comment'), (r',', Punctuation), (r'[:!#$%&*+.\\/<=>?@^|~-]+', Operator), # (HACK, but it makes sense to push two instances, believe me) diff --git a/pygments/lexers/int_fiction.py b/pygments/lexers/int_fiction.py index b464496b..34641578 100644 --- a/pygments/lexers/int_fiction.py +++ b/pygments/lexers/int_fiction.py @@ -117,7 +117,7 @@ class Inform6Lexer(RegexLexer): include('_whitespace'), # Strings (r'[%s][^@][%s]' % (_squote, _squote), String.Char, '#pop'), - (r'([%s])(@{[0-9a-fA-F]{1,4}})([%s])' % (_squote, _squote), + (r'([%s])(@\{[0-9a-fA-F]{1,4}\})([%s])' % (_squote, _squote), bygroups(String.Char, String.Escape, String.Char), '#pop'), (r'([%s])(@..)([%s])' % (_squote, _squote), bygroups(String.Char, String.Escape, String.Char), '#pop'), @@ -190,8 +190,8 @@ class Inform6Lexer(RegexLexer): (r'\\', String.Escape), (r'@(\\\s*[%s]\s*)*@((\\\s*[%s]\s*)*[0-9])*' % (_newline, _newline), String.Escape), - (r'@(\\\s*[%s]\s*)*{((\\\s*[%s]\s*)*[0-9a-fA-F]){,4}' - r'(\\\s*[%s]\s*)*}' % (_newline, _newline, _newline), + (r'@(\\\s*[%s]\s*)*\{((\\\s*[%s]\s*)*[0-9a-fA-F]){,4}' + r'(\\\s*[%s]\s*)*\}' % (_newline, _newline, _newline), String.Escape), (r'@(\\\s*[%s]\s*)*.(\\\s*[%s]\s*)*.' % (_newline, _newline), String.Escape), @@ -643,20 +643,20 @@ class Inform7Lexer(RegexLexer): ], '+i6t-use-option': [ include('+i6t-not-inline'), - (r'({)(N)(})', bygroups(Punctuation, Text, Punctuation)) + (r'(\{)(N)(\})', bygroups(Punctuation, Text, Punctuation)) ], '+i6t-inline': [ - (r'({)(\S[^}]*)?(})', + (r'(\{)(\S[^}]*)?(\})', bygroups(Punctuation, using(this, state='+main'), Punctuation)) ], '+i6t': [ - (r'({[%s])(![^}]*)(}?)' % _dash, + (r'(\{[%s])(![^}]*)(\}?)' % _dash, bygroups(Punctuation, Comment.Single, Punctuation)), - (r'({[%s])(lines)(:)([^}]*)(}?)' % _dash, + (r'(\{[%s])(lines)(:)([^}]*)(\}?)' % _dash, bygroups(Punctuation, Keyword, Punctuation, Text, Punctuation), '+lines'), - (r'({[%s])([^:}]*)(:?)([^}]*)(}?)' % _dash, + (r'(\{[%s])([^:}]*)(:?)([^}]*)(\}?)' % _dash, bygroups(Punctuation, Keyword, Punctuation, Text, Punctuation)), (r'(\(\+)(.*?)(\+\)|\Z)', @@ -681,7 +681,7 @@ class Inform7Lexer(RegexLexer): Generic.Heading, '+p'), (r'(%s)@[a-zA-Z_0-9]*[ %s]' % (_start, _newline), Keyword), (r'![^%s]*' % _newline, Comment.Single), - (r'({)([%s]endlines)(})' % _dash, + (r'(\{)([%s]endlines)(\})' % _dash, bygroups(Punctuation, Keyword, Punctuation), '#pop'), (r'[^@!{]+?([%s]|\Z)|.' % _newline, Text) ] @@ -791,7 +791,7 @@ class Tads3Lexer(RegexLexer): ] state += [ include('s/escape'), - (r'{([^}<\\%s]|<(?!<)|\\%s%s|%s|\\.)*}' % + (r'\{([^}<\\%s]|<(?!<)|\\%s%s|%s|\\.)*\}' % (char, char, escaped_quotes, _escape), String.Interpol), (r'[\\&{}<]', token) ] @@ -812,7 +812,7 @@ class Tads3Lexer(RegexLexer): 'sqs/%s' % state_name), (r'=', Punctuation, 'uqs/%s' % state_name), (r'\\?>', Name.Tag, '#pop'), - (r'{([^}<\\%s]|<(?!<)|\\%s%s|%s|\\.)*}' % + (r'\{([^}<\\%s]|<(?!<)|\\%s%s|%s|\\.)*\}' % (char, char, escaped_quotes, _escape), String.Interpol), (r'([^\s=><\\%s]|<(?!<)|\\%s%s|%s|\\.)+' % (char, char, escaped_quotes, _escape), Name.Attribute), @@ -837,7 +837,7 @@ class Tads3Lexer(RegexLexer): token, '#pop'), include('s/verbatim'), include('s/entity'), - (r'{([^}<\\%s]|<(?!<)|\\%s%s|%s|\\.)*}' % + (r'\{([^}<\\%s]|<(?!<)|\\%s%s|%s|\\.)*\}' % (host_char, host_char, escaped_quotes, _escape), String.Interpol), (r'([^\s"\'<%s{}\\&])+' % (r'>' if token is String.Other else r''), token), @@ -881,7 +881,7 @@ class Tads3Lexer(RegexLexer): bygroups(Name.Function, using(this, state='whitespace'), Punctuation), ('block?', 'more/parameters', 'main/parameters')), - (r'(%s)(%s*)({)' % (_name, _ws), + (r'(%s)(%s*)(\{)' % (_name, _ws), bygroups(Name.Function, using(this, state='whitespace'), Punctuation), 'block'), (r'(%s)(%s*)(:)' % (_name, _ws), @@ -1237,7 +1237,7 @@ class Tads3Lexer(RegexLexer): (r"'", String.Single, 'sqs') ], 's/escape': [ - (r'{{|}}|%s' % _escape, String.Escape) + (r'\{\{|\}\}|%s' % _escape, String.Escape) ], 's/verbatim': [ (r'<<\s*(as\s+decreasingly\s+likely\s+outcomes|cycling|else|end|' diff --git a/pygments/lexers/javascript.py b/pygments/lexers/javascript.py index 57870009..4148c6b0 100644 --- a/pygments/lexers/javascript.py +++ b/pygments/lexers/javascript.py @@ -776,7 +776,7 @@ class ObjectiveJLexer(RegexLexer): include('whitespace'), # function definition - (r'^(' + _ws + r'[\+-]' + _ws + r')([\(a-zA-Z_].*?[^\(])(' + _ws + '{)', + (r'^(' + _ws + r'[\+-]' + _ws + r')([\(a-zA-Z_].*?[^\(])(' + _ws + r'\{)', bygroups(using(this), using(this, state='function_signature'), using(this))), diff --git a/pygments/lexers/modeling.py b/pygments/lexers/modeling.py index c2b365b3..02e2936e 100644 --- a/pygments/lexers/modeling.py +++ b/pygments/lexers/modeling.py @@ -309,7 +309,7 @@ class StanLexer(RegexLexer): # block start include('whitespace'), # Block start - (r'(%s)(\s*)({)' % + (r'(%s)(\s*)(\{)' % r'|'.join(('functions', 'data', r'transformed\s+?data', 'parameters', r'transformed\s+parameters', 'model', r'generated\s+quantities')), diff --git a/pygments/lexers/objective.py b/pygments/lexers/objective.py index 8cb02170..9287fae0 100644 --- a/pygments/lexers/objective.py +++ b/pygments/lexers/objective.py @@ -86,19 +86,19 @@ def objective(baselexer): ], 'oc_classname': [ # interface definition that inherits - ('([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?(\s*)({)', + ('([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?(\s*)(\{)', bygroups(Name.Class, Text, Name.Class, Text, Punctuation), ('#pop', 'oc_ivars')), ('([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?', bygroups(Name.Class, Text, Name.Class), '#pop'), # interface definition for a category - ('([a-zA-Z$_][\w$]*)(\s*)(\([a-zA-Z$_][\w$]*\))(\s*)({)', + ('([a-zA-Z$_][\w$]*)(\s*)(\([a-zA-Z$_][\w$]*\))(\s*)(\{)', bygroups(Name.Class, Text, Name.Label, Text, Punctuation), ('#pop', 'oc_ivars')), ('([a-zA-Z$_][\w$]*)(\s*)(\([a-zA-Z$_][\w$]*\))', bygroups(Name.Class, Text, Name.Label), '#pop'), # simple interface / implementation - ('([a-zA-Z$_][\w$]*)(\s*)({)', + ('([a-zA-Z$_][\w$]*)(\s*)(\{)', bygroups(Name.Class, Text, Punctuation), ('#pop', 'oc_ivars')), ('([a-zA-Z$_][\w$]*)', Name.Class, '#pop') ], diff --git a/pygments/lexers/parsers.py b/pygments/lexers/parsers.py index e89602c6..e84447b3 100644 --- a/pygments/lexers/parsers.py +++ b/pygments/lexers/parsers.py @@ -173,8 +173,8 @@ class RagelEmbeddedLexer(RegexLexer): (r'(' + r'|'.join(( # keep ragel code in largest possible chunks. r'(' + r'|'.join(( r'[^}\'"\[/#]', # exclude unsafe characters - r'}(?=[^%]|$)', # } is okay as long as it's not followed by % - r'}%(?=[^%]|$)', # ...well, one %'s okay, just not two... + r'\}(?=[^%]|$)', # } is okay as long as it's not followed by % + r'\}%(?=[^%]|$)', # ...well, one %'s okay, just not two... r'[^\\]\\[{}]', # ...and } is okay if it's escaped # allow / if it's preceded with one of these symbols @@ -202,7 +202,7 @@ class RagelEmbeddedLexer(RegexLexer): r'\#.*$\n?', # ruby/ragel comment )) + r')+', using(RagelLexer)), - (r'}%%', Punctuation, '#pop'), + (r'\}%%', Punctuation, '#pop'), ] } diff --git a/pygments/lexers/webmisc.py b/pygments/lexers/webmisc.py index 2f3707f6..7b40b575 100644 --- a/pygments/lexers/webmisc.py +++ b/pygments/lexers/webmisc.py @@ -713,7 +713,7 @@ class XQueryLexer(ExtendedRegexLexer): (r'//|/|\+|-|;|,|\(|\)', Punctuation), # STANDALONE QNAMES - (qname + r'(?=\s*{)', Name.Tag, 'qname_braren'), + (qname + r'(?=\s*\{)', Name.Tag, 'qname_braren'), (qname + r'(?=\s*\([^:])', Name.Function, 'qname_braren'), (qname, Name.Tag, 'operator'), ] |