summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhhsprings <xwhhsprings@gmail.com>2015-11-01 11:28:05 +0900
committerhhsprings <xwhhsprings@gmail.com>2015-11-01 11:28:05 +0900
commitd7ebb3aac453a57ee12ce0f7020c5ef645c87362 (patch)
tree8a7582256fe258b78478e0320ca422494b387aaa
parent93c7c9220552bd64154d63b38914de36c9939d86 (diff)
downloadpygments-d7ebb3aac453a57ee12ce0f7020c5ef645c87362.tar.gz
Fix regarding to Tim's review.
1. move to my contribution notice to AUTHORS 2. some styles. 3. remove unnecessary nested comment support (BC doesn't support it.) 4. use `word` for Keyword Thanks!
-rw-r--r--AUTHORS2
-rw-r--r--pygments/lexers/algebra.py17
2 files changed, 9 insertions, 10 deletions
diff --git a/AUTHORS b/AUTHORS
index d8d58e8a..8a5a9ed7 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -88,7 +88,7 @@ Other contributors, listed alphabetically, are:
* Tim Howard -- BlitzMax lexer
* Dustin Howett -- Logos lexer
* Ivan Inozemtsev -- Fantom lexer
-* Hiroaki Itoh -- Shell console rewrite
+* Hiroaki Itoh -- Shell console rewrite, BC Lexer
* Brian R. Jackson -- Tea lexer
* Christian Jann -- ShellSession lexer
* Dennis Kaarsemaker -- sources.list lexer
diff --git a/pygments/lexers/algebra.py b/pygments/lexers/algebra.py
index a0d6b4ce..88683e82 100644
--- a/pygments/lexers/algebra.py
+++ b/pygments/lexers/algebra.py
@@ -65,7 +65,7 @@ class GAPLexer(RegexLexer):
(r'[0-9]+(?:\.[0-9]*)?(?:e[0-9]+)?', Number),
(r'\.[0-9]+(?:e[0-9]+)?', Number),
(r'.', Text)
- ]
+ ],
}
@@ -183,14 +183,13 @@ class MuPADLexer(RegexLexer):
(r'/\*', Comment.Multiline, '#push'),
(r'\*/', Comment.Multiline, '#pop'),
(r'[*/]', Comment.Multiline)
- ]
+ ],
}
class BCLexer(RegexLexer):
"""
A `BC <https://www.gnu.org/software/bc/>`_ lexer.
- Contributed by Hiroaki Itoh <https://bitbucket.org/hhsprings>.
.. versionadded:: 2.1
"""
@@ -203,19 +202,19 @@ class BCLexer(RegexLexer):
(r'/\*', Comment.Multiline, 'comment'),
(r'"(?:[^"\\]|\\.)*"', String),
(r'[{}();,]', Punctuation),
- (r'(if|else|while|for|break|continue|halt|'
- r'return|define|auto|print|'
- r'read|length|scale|sqrt|limits|quit|warranty)\b', Keyword),
+ (words(('if', 'else', 'while', 'for', 'break', 'continue',
+ 'halt', 'return', 'define', 'auto', 'print', 'read',
+ 'length', 'scale', 'sqrt', 'limits', 'quit',
+ 'warranty'), suffix=r'\b'), Keyword),
(r'\+\+|--|\|\||&&|'
r'([-<>+*%\^/!=])=?', Operator),
(r'[0-9]+(?:\.[0-9]*)?(?:e[0-9]+)?', Number),
(r'\.[0-9]+(?:e[0-9]+)?', Number),
(r'.', Text)
- ],
+ ],
'comment': [
(r'[^*/]', Comment.Multiline),
- (r'/\*', Comment.Multiline, '#push'),
(r'\*/', Comment.Multiline, '#pop'),
(r'[*/]', Comment.Multiline)
- ]
+ ],
}