summaryrefslogtreecommitdiff
path: root/pygments/lexers
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2017-01-17 08:25:28 +0100
committerGeorg Brandl <georg@python.org>2017-01-17 08:25:28 +0100
commit94d23ec1b83cd66509e8d16c1ae69f31d2b6013d (patch)
tree50b926397ed4b49b771d51aa52c4663fe270873d /pygments/lexers
parentd410f2237de3b47650f69d4f4f2dae310aa6097e (diff)
parent36b8fb2096c234912ed0242a1c76a102d8f0fdc0 (diff)
downloadpygments-git-94d23ec1b83cd66509e8d16c1ae69f31d2b6013d.tar.gz
Merged in jayvdb/pygments-main (pull request #665)
Provide explanation when a test is skipped
Diffstat (limited to 'pygments/lexers')
-rw-r--r--pygments/lexers/_mapping.py2
-rw-r--r--pygments/lexers/asm.py6
-rw-r--r--pygments/lexers/dsls.py2
-rw-r--r--pygments/lexers/haskell.py5
-rw-r--r--pygments/lexers/javascript.py16
-rw-r--r--pygments/lexers/python.py1
-rw-r--r--pygments/lexers/verification.py4
7 files changed, 19 insertions, 17 deletions
diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py
index a6097b1c..12c3d5f4 100644
--- a/pygments/lexers/_mapping.py
+++ b/pygments/lexers/_mapping.py
@@ -378,7 +378,7 @@ LEXERS = {
'ScilabLexer': ('pygments.lexers.matlab', 'Scilab', ('scilab',), ('*.sci', '*.sce', '*.tst'), ('text/scilab',)),
'ScssLexer': ('pygments.lexers.css', 'SCSS', ('scss',), ('*.scss',), ('text/x-scss',)),
'ShenLexer': ('pygments.lexers.lisp', 'Shen', ('shen',), ('*.shen',), ('text/x-shen', 'application/x-shen')),
- 'SilverLexer': ('pygments.lexers.verification', 'Silver', ('silver',), ('*.sil',), ()),
+ 'SilverLexer': ('pygments.lexers.verification', 'Silver', ('silver',), ('*.sil', '*.vpr'), ()),
'SlimLexer': ('pygments.lexers.webmisc', 'Slim', ('slim',), ('*.slim',), ('text/x-slim',)),
'SmaliLexer': ('pygments.lexers.dalvik', 'Smali', ('smali',), ('*.smali',), ('text/smali',)),
'SmalltalkLexer': ('pygments.lexers.smalltalk', 'Smalltalk', ('smalltalk', 'squeak', 'st'), ('*.st',), ('text/x-smalltalk',)),
diff --git a/pygments/lexers/asm.py b/pygments/lexers/asm.py
index 2bb3eac9..4c58e54b 100644
--- a/pygments/lexers/asm.py
+++ b/pygments/lexers/asm.py
@@ -54,8 +54,6 @@ class GasLexer(RegexLexer):
(number, Number.Integer),
(r'[\r\n]+', Text, '#pop'),
- (r'#.*?$', Comment, '#pop'),
-
include('punctuation'),
include('whitespace')
],
@@ -78,14 +76,14 @@ class GasLexer(RegexLexer):
('$'+number, Number.Integer),
(r"$'(.|\\')'", String.Char),
(r'[\r\n]+', Text, '#pop'),
- (r'#.*?$', Comment, '#pop'),
+
include('punctuation'),
include('whitespace')
],
'whitespace': [
(r'\n', Text),
(r'\s+', Text),
- (r'#.*?\n', Comment)
+ (r'[;#].*?\n', Comment)
],
'punctuation': [
(r'[-*,.()\[\]!:]+', Punctuation)
diff --git a/pygments/lexers/dsls.py b/pygments/lexers/dsls.py
index 312d5f5e..4044b7c5 100644
--- a/pygments/lexers/dsls.py
+++ b/pygments/lexers/dsls.py
@@ -36,7 +36,7 @@ class ProtoBufLexer(RegexLexer):
tokens = {
'root': [
(r'[ \t]+', Text),
- (r'[,;{}\[\]()]', Punctuation),
+ (r'[,;{}\[\]()<>]', Punctuation),
(r'/(\\\n)?/(\n|(.|\n)*?[^\\]\n)', Comment.Single),
(r'/(\\\n)?\*(.|\n)*?\*(\\\n)?/', Comment.Multiline),
(words((
diff --git a/pygments/lexers/haskell.py b/pygments/lexers/haskell.py
index ffc3a3a2..b85a8d58 100644
--- a/pygments/lexers/haskell.py
+++ b/pygments/lexers/haskell.py
@@ -39,7 +39,7 @@ class HaskellLexer(RegexLexer):
flags = re.MULTILINE | re.UNICODE
reserved = ('case', 'class', 'data', 'default', 'deriving', 'do', 'else',
- 'if', 'in', 'infix[lr]?', 'instance',
+ 'family', 'if', 'in', 'infix[lr]?', 'instance',
'let', 'newtype', 'of', 'then', 'type', 'where', '_')
ascii = ('NUL', 'SOH', '[SE]TX', 'EOT', 'ENQ', 'ACK',
'BEL', 'BS', 'HT', 'LF', 'VT', 'FF', 'CR', 'S[OI]', 'DLE',
@@ -63,6 +63,9 @@ class HaskellLexer(RegexLexer):
(r'^[_' + uni.Ll + r'][\w\']*', Name.Function),
(r"'?[_" + uni.Ll + r"][\w']*", Name),
(r"('')?[" + uni.Lu + r"][\w\']*", Keyword.Type),
+ (r"(')[" + uni.Lu + r"][\w\']*", Keyword.Type),
+ (r"(')\[[^\]]*\]", Keyword.Type), # tuples and lists get special treatment in GHC
+ (r"(')\([^\)]*\)", Keyword.Type), # ..
# Operators
(r'\\(?![:!#$%&*+.\\/<=>?@^|~-]+)', Name.Function), # lambda operator
(r'(<-|::|->|=>|=)(?![:!#$%&*+.\\/<=>?@^|~-]+)', Operator.Word), # specials
diff --git a/pygments/lexers/javascript.py b/pygments/lexers/javascript.py
index a23ba184..4b47b15a 100644
--- a/pygments/lexers/javascript.py
+++ b/pygments/lexers/javascript.py
@@ -53,7 +53,7 @@ class JavascriptLexer(RegexLexer):
'slashstartsregex': [
include('commentsandwhitespace'),
(r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
- r'([gim]+\b|\B)', String.Regex, '#pop'),
+ r'([gimuy]+\b|\B)', String.Regex, '#pop'),
(r'(?=/)', Text, ('#pop', 'badregex')),
default('#pop')
],
@@ -64,9 +64,14 @@ class JavascriptLexer(RegexLexer):
(r'\A#! ?/.*?\n', Comment.Hashbang), # recognized by node.js
(r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
include('commentsandwhitespace'),
+ (r'(\.\d+|[0-9]+\.[0-9]*)([eE][-+]?[0-9]+)?', Number.Float),
+ (r'0[bB][01]+', Number.Bin),
+ (r'0[oO][0-7]+', Number.Oct),
+ (r'0[xX][0-9a-fA-F]+', Number.Hex),
+ (r'[0-9]+', Number.Integer),
+ (r'\.\.\.|=>', Punctuation),
(r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|'
- r'(<<|>>>?|=>|==?|!=?|[-<>+*%&|^/])=?', Operator, 'slashstartsregex'),
- (r'\.\.\.', Punctuation),
+ r'(<<|>>>?|==?|!=?|[-<>+*%&|^/])=?', Operator, 'slashstartsregex'),
(r'[{(\[;,]', Punctuation, 'slashstartsregex'),
(r'[})\].]', Punctuation),
(r'(for|in|while|do|break|return|continue|switch|case|default|if|else|'
@@ -84,11 +89,6 @@ class JavascriptLexer(RegexLexer):
r'Error|eval|isFinite|isNaN|isSafeInteger|parseFloat|parseInt|'
r'document|this|window)\b', Name.Builtin),
(JS_IDENT, Name.Other),
- (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
- (r'0b[01]+', Number.Bin),
- (r'0o[0-7]+', Number.Oct),
- (r'0x[0-9a-fA-F]+', Number.Hex),
- (r'[0-9]+', Number.Integer),
(r'"(\\\\|\\"|[^"])*"', String.Double),
(r"'(\\\\|\\'|[^'])*'", String.Single),
(r'`', String.Backtick, 'interp'),
diff --git a/pygments/lexers/python.py b/pygments/lexers/python.py
index 35635ed1..d41dd08d 100644
--- a/pygments/lexers/python.py
+++ b/pygments/lexers/python.py
@@ -362,6 +362,7 @@ class Python3Lexer(RegexLexer):
]
tokens['numbers'] = [
(r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
+ (r'\d+[eE][+-]?[0-9]+j?', Number.Float),
(r'0[oO][0-7]+', Number.Oct),
(r'0[bB][01]+', Number.Bin),
(r'0[xX][a-fA-F0-9]+', Number.Hex),
diff --git a/pygments/lexers/verification.py b/pygments/lexers/verification.py
index 3e77e04a..1ffee0ab 100644
--- a/pygments/lexers/verification.py
+++ b/pygments/lexers/verification.py
@@ -69,7 +69,7 @@ class SilverLexer(RegexLexer):
"""
name = 'Silver'
aliases = ['silver']
- filenames = ['*.sil']
+ filenames = ['*.sil', '*.vpr']
tokens = {
'root': [
@@ -89,7 +89,7 @@ class SilverLexer(RegexLexer):
'constraining', 'Seq', 'Set', 'Multiset', 'union', 'intersection',
'setminus', 'subset', 'unfolding', 'in', 'old', 'forall', 'exists',
'acc', 'wildcard', 'write', 'none', 'epsilon', 'perm', 'unique',
- 'apply', 'package', 'folding', 'label'),
+ 'apply', 'package', 'folding', 'label', 'forperm'),
suffix=r'\b'), Keyword),
(words(('Int', 'Perm', 'Bool', 'Ref'), suffix=r'\b'), Keyword.Type),
include('numbers'),