summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2017-01-22 19:29:02 +0100
committerGeorg Brandl <georg@python.org>2017-01-22 19:29:02 +0100
commitf4ae879f01a412a44f3a1114bbb63ff895a86670 (patch)
tree7d6f6523aa91564954031af917ced33418ab6850 /pygments
parent6068b24c07b210aed357e5abcdc923291559278a (diff)
downloadpygments-f4ae879f01a412a44f3a1114bbb63ff895a86670.tar.gz
ABAP: a few minor fixes
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/business.py15
-rw-r--r--pygments/styles/__init__.py1
-rw-r--r--pygments/styles/abap.py46
3 files changed, 38 insertions, 24 deletions
diff --git a/pygments/lexers/business.py b/pygments/lexers/business.py
index d218261e..12ed6925 100644
--- a/pygments/lexers/business.py
+++ b/pygments/lexers/business.py
@@ -285,8 +285,8 @@ class ABAPLexer(RegexLexer):
bygroups(Text, Name.Variable, Operator, Name.Function)),
# call methodnames returning style
(r'(?<=(=|-)>)([\w\-~]+)(?=\()', Name.Function),
-
- #text elements
+
+ # text elements
(r'(TEXT)(-)(\d{3})',
bygroups(Keyword, Punctuation, Number.Integer)),
(r'(TEXT)(-)(\w{3})',
@@ -372,7 +372,7 @@ class ABAPLexer(RegexLexer):
# single word keywords.
(r'(^|(?<=(\s|\.)))(ABBREVIATED|ABSTRACT|ADD|ALIASES|ALIGN|ALPHA|'
- r'AS|ASSERT|ASSIGN(ING)?|AT(\s+FIRST)?|'
+ r'ASSERT|AS|ASSIGN(ING)?|AT(\s+FIRST)?|'
r'BACK|BLOCK|BREAK-POINT|'
r'CASE|CATCH|CHANGING|CHECK|CLASS|CLEAR|COLLECT|COLOR|COMMIT|'
r'CREATE|COMMUNICATION|COMPONENTS?|COMPUTE|CONCATENATE|CONDENSE|'
@@ -394,14 +394,14 @@ class ABAPLexer(RegexLexer):
r'NODES|NUMBER|'
r'OBLIGATORY|OBJECT|OF|OFF|ON|OTHERS|OVERLAY|'
r'PACK|PAD|PARAMETERS|PERCENTAGE|POSITION|PROGRAM|PROVIDE|PUBLIC|PUT|PF\d\d|'
- r'RAISE|RAISING|RANGE|RANGES|READ|RECEIVE|REDEFINITION|REFRESH|REJECT|REPORT|RESERVE|'
+ r'RAISE|RAISING|RANGES?|READ|RECEIVE|REDEFINITION|REFRESH|REJECT|REPORT|RESERVE|'
r'RESUME|RETRY|RETURN|RETURNING|RIGHT|ROLLBACK|REPLACE|'
r'SCROLL|SEARCH|SELECT|SHIFT|SIGN|SINGLE|SIZE|SKIP|SORT|SPLIT|STATICS|STOP|'
r'STYLE|SUBMATCHES|SUBMIT|SUBTRACT|SUM(?!\()|SUMMARY|SUMMING|SUPPLY|'
- r'TABLE|TABLES|TIME|TIMES|TIMESTAMP|TIMEZONE|TITLE|\??TO|'
+ r'TABLE|TABLES|TIMESTAMP|TIMES?|TIMEZONE|TITLE|\??TO|'
r'TOP-OF-PAGE|TRANSFER|TRANSLATE|TRY|TYPES|'
r'ULINE|UNDER|UNPACK|UPDATE|USING|'
- r'VALUE|VALUES|VIA|VARY|VARYING|'
+ r'VALUE|VALUES|VIA|VARYING|VARY|'
r'WAIT|WHEN|WHERE|WIDTH|WHILE|WITH|WINDOW|WRITE|XSD|ZERO)\b', Keyword),
# builtins
@@ -439,7 +439,8 @@ class ABAPLexer(RegexLexer):
(r'[?*<>=\-+&]', Operator),
(r"'(''|[^'])*'", String.Single),
(r"`([^`])*`", String.Single),
- (r"([\|\}])([^\{\}\|]*?)([\|\{])", bygroups(Punctuation, String.Single, Punctuation)),
+ (r"([\|\}])([^\{\}\|]*?)([\|\{])",
+ bygroups(Punctuation, String.Single, Punctuation)),
(r'[/;:()\[\],.]', Punctuation),
(r'(!)(\w+)', bygroups(Operator, Name)),
],
diff --git a/pygments/styles/__init__.py b/pygments/styles/__init__.py
index e1c0c39c..839a9b78 100644
--- a/pygments/styles/__init__.py
+++ b/pygments/styles/__init__.py
@@ -43,6 +43,7 @@ STYLE_MAP = {
'algol_nu': 'algol_nu::Algol_NuStyle',
'arduino': 'arduino::ArduinoStyle',
'rainbow_dash': 'rainbow_dash::RainbowDashStyle',
+ 'abap': 'abap::AbapStyle',
}
diff --git a/pygments/styles/abap.py b/pygments/styles/abap.py
index b2c04e3e..91286a3a 100644
--- a/pygments/styles/abap.py
+++ b/pygments/styles/abap.py
@@ -1,17 +1,29 @@
-from pygments.style import Style
-from pygments.token import Keyword, Name, Comment, String, Error, \
- Number, Operator, Generic
-
-class AbapStyle(Style):
- default_style = ""
- styles = {
- Comment: 'italic #888',
- Comment.Special: '#888',
- Keyword: '#00f',
- Operator.Word: '#00f',
- Name: '#000',
- Number: '#3af',
- String: '#5a2',
-
- Error: '#F00'
- } \ No newline at end of file
+# -*- coding: utf-8 -*-
+"""
+ pygments.styles.abap
+ ~~~~~~~~~~~~~~~~~~~~
+
+ ABAP workbench like style.
+
+ :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+from pygments.style import Style
+from pygments.token import Keyword, Name, Comment, String, Error, \
+ Number, Operator
+
+
+class AbapStyle(Style):
+ default_style = ""
+ styles = {
+ Comment: 'italic #888',
+ Comment.Special: '#888',
+ Keyword: '#00f',
+ Operator.Word: '#00f',
+ Name: '#000',
+ Number: '#3af',
+ String: '#5a2',
+
+ Error: '#F00',
+ }