summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2021-02-14 19:37:33 +0100
committerGeorg Brandl <georg@python.org>2021-02-14 19:38:52 +0100
commit64ecc8f50d87c71e16fa133a1eabe5b0a1aa4a4c (patch)
tree6d0bbebf8448235fcb8d6c529136a593111cba0d /pygments
parentf5472bbb595e617ed3d491c4fc3610d8d69e9aa9 (diff)
downloadpygments-git-64ecc8f50d87c71e16fa133a1eabe5b0a1aa4a4c.tar.gz
minor formatting fixups for new lexers
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/amdgpu.py5
-rw-r--r--pygments/lexers/cddl.py2
-rw-r--r--pygments/lexers/futhark.py9
-rw-r--r--pygments/lexers/graphviz.py9
-rw-r--r--pygments/lexers/matlab.py5
5 files changed, 16 insertions, 14 deletions
diff --git a/pygments/lexers/amdgpu.py b/pygments/lexers/amdgpu.py
index 529a687b..c284d343 100644
--- a/pygments/lexers/amdgpu.py
+++ b/pygments/lexers/amdgpu.py
@@ -15,6 +15,7 @@ import re
__all__ = ['AMDGPULexer']
+
class AMDGPULexer(RegexLexer):
"""
For AMD GPU assembly.
@@ -24,7 +25,7 @@ class AMDGPULexer(RegexLexer):
name = 'AMDGPU'
aliases = ['amdgpu']
filenames = ['*.isa']
-
+
flags = re.IGNORECASE
tokens = {
@@ -45,4 +46,4 @@ class AMDGPULexer(RegexLexer):
(r'[0-9]+\.[^0-9]+', Number.Float),
(r'(0[xX][a-z0-9]+)|([0-9]+)', Number.Integer)
]
- } \ No newline at end of file
+ }
diff --git a/pygments/lexers/cddl.py b/pygments/lexers/cddl.py
index 09bb5839..72b34642 100644
--- a/pygments/lexers/cddl.py
+++ b/pygments/lexers/cddl.py
@@ -119,7 +119,7 @@ class CddlLexer(RegexLexer):
"root": [
include("commentsandwhitespace"),
# tag types
- (r"#(\d\.{uint})?".format(uint=_re_uint), Keyword.Type), # type or any
+ (r"#(\d\.{uint})?".format(uint=_re_uint), Keyword.Type), # type or any
# occurence
(
r"({uint})?(\*)({uint})?".format(uint=_re_uint),
diff --git a/pygments/lexers/futhark.py b/pygments/lexers/futhark.py
index 8892bb79..f580ea72 100644
--- a/pygments/lexers/futhark.py
+++ b/pygments/lexers/futhark.py
@@ -10,9 +10,9 @@
import re
-from pygments.lexer import RegexLexer, include, bygroups, default, words
+from pygments.lexer import RegexLexer
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation, Error
+ Number, Punctuation
from pygments import unistring as uni
__all__ = ['FutharkLexer']
@@ -25,7 +25,7 @@ class FutharkLexer(RegexLexer):
"""
A Futhark lexer
- .. versionadded:: 2.8.0
+ .. versionadded:: 2.8
"""
name = 'Futhark'
aliases = ['futhark']
@@ -70,7 +70,8 @@ class FutharkLexer(RegexLexer):
(r'[][(),:;`{}]', Punctuation),
# Numbers
- (r'0[xX]_*[\da-fA-F](_*[\da-fA-F])*_*[pP][+-]?\d(_*\d)*' + num_postfix, Number.Float),
+ (r'0[xX]_*[\da-fA-F](_*[\da-fA-F])*_*[pP][+-]?\d(_*\d)*' + num_postfix,
+ Number.Float),
(r'0[xX]_*[\da-fA-F](_*[\da-fA-F])*\.[\da-fA-F](_*[\da-fA-F])*'
r'(_*[pP][+-]?\d(_*\d)*)?' + num_postfix, Number.Float),
(r'\d(_*\d)*_*[eE][+-]?\d(_*\d)*' + num_postfix, Number.Float),
diff --git a/pygments/lexers/graphviz.py b/pygments/lexers/graphviz.py
index 55cf2e4c..a6859337 100644
--- a/pygments/lexers/graphviz.py
+++ b/pygments/lexers/graphviz.py
@@ -9,7 +9,8 @@
"""
from pygments.lexer import RegexLexer, bygroups
-from pygments.token import Comment, Keyword, Operator, Name, String, Number, Punctuation, Whitespace
+from pygments.token import Comment, Keyword, Operator, Name, String, Number, \
+ Punctuation, Whitespace
__all__ = ['GraphvizLexer']
@@ -37,9 +38,9 @@ class GraphvizLexer(RegexLexer):
bygroups(Name.Attribute, Whitespace, Punctuation, Whitespace),
'attr_id'),
(r'\b(n|ne|e|se|s|sw|w|nw|c|_)\b', Name.Builtin),
- (r'\b\D\w*', Name.Tag), # node
+ (r'\b\D\w*', Name.Tag), # node
(r'[-]?((\.[0-9]+)|([0-9]+(\.[0-9]*)?))', Number),
- (r'"(\\"|[^"])*?"', Name.Tag), # quoted node
+ (r'"(\\"|[^"])*?"', Name.Tag), # quoted node
(r'<', Punctuation, 'xml'),
],
'attr_id': [
@@ -54,4 +55,4 @@ class GraphvizLexer(RegexLexer):
(r'\s+', Whitespace),
(r'[^<>\s]', Name.Tag),
]
- } \ No newline at end of file
+ }
diff --git a/pygments/lexers/matlab.py b/pygments/lexers/matlab.py
index 7a72eedc..7e091022 100644
--- a/pygments/lexers/matlab.py
+++ b/pygments/lexers/matlab.py
@@ -20,7 +20,6 @@ from pygments.lexers import _scilab_builtins
__all__ = ['MatlabLexer', 'MatlabSessionLexer', 'OctaveLexer', 'ScilabLexer']
-
class MatlabLexer(RegexLexer):
"""
For Matlab source code.
@@ -2783,8 +2782,8 @@ class MatlabSessionLexer(Lexer):
# Set leading spaces with the length of the prompt to be a generic prompt
# This keeps code aligned when prompts are removed, say with some Javascript
if line.startswith(' '*line_start):
- insertions.append((len(curcode),
- [(0, Generic.Prompt, line[:line_start])]))
+ insertions.append(
+ (len(curcode), [(0, Generic.Prompt, line[:line_start])]))
curcode += line[line_start:]
else:
curcode += line