3 pygments.lexers.business |
3 pygments.lexers.business |
4 ~~~~~~~~~~~~~~~~~~~~~~~~ |
4 ~~~~~~~~~~~~~~~~~~~~~~~~ |
5 |
5 |
6 Lexers for "business-oriented" languages. |
6 Lexers for "business-oriented" languages. |
7 |
7 |
8 :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. |
8 :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. |
9 :license: BSD, see LICENSE for details. |
9 :license: BSD, see LICENSE for details. |
10 """ |
10 """ |
11 |
11 |
12 import re |
12 import re |
13 |
13 |
476 (r'\s*&.*', Comment.Preproc), |
476 (r'\s*&.*', Comment.Preproc), |
477 (r'0[xX][0-9a-fA-F]+[LlUu]*', Number.Hex), |
477 (r'0[xX][0-9a-fA-F]+[LlUu]*', Number.Hex), |
478 (r'(?i)(DEFINE|DEF|DEFI|DEFIN)\b', Keyword.Declaration), |
478 (r'(?i)(DEFINE|DEF|DEFI|DEFIN)\b', Keyword.Declaration), |
479 (types, Keyword.Type), |
479 (types, Keyword.Type), |
480 (keywords, Name.Builtin), |
480 (keywords, Name.Builtin), |
481 (r'"(\\\\|\\"|[^"])*"', String.Double), |
481 (r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double), |
482 (r"'(\\\\|\\'|[^'])*'", String.Single), |
482 (r"'(\\\\|\\[^\\]|[^'\\])*'", String.Single), |
483 (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), |
483 (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), |
484 (r'[0-9]+', Number.Integer), |
484 (r'[0-9]+', Number.Integer), |
485 (r'\s+', Text), |
485 (r'\s+', Text), |
486 (r'[+*/=-]', Operator), |
486 (r'[+*/=-]', Operator), |
487 (r'[.:()]', Punctuation), |
487 (r'[.:()]', Punctuation), |
497 (r'[^{}]', Comment.Preproc), |
497 (r'[^{}]', Comment.Preproc), |
498 (r'\{', Comment.Preproc, '#push'), |
498 (r'\{', Comment.Preproc, '#push'), |
499 (r'\}', Comment.Preproc, '#pop'), |
499 (r'\}', Comment.Preproc, '#pop'), |
500 ], |
500 ], |
501 } |
501 } |
|
502 |
|
503 def analyse_text(text): |
|
504 """Try to identify OpenEdge ABL based on a few common constructs.""" |
|
505 result = 0 |
|
506 |
|
507 if 'END.' in text: |
|
508 result += 0.05 |
|
509 |
|
510 if 'END PROCEDURE.' in text: |
|
511 result += 0.05 |
|
512 |
|
513 if 'ELSE DO:' in text: |
|
514 result += 0.05 |
|
515 |
|
516 return result |
502 |
517 |
503 |
518 |
504 class GoodDataCLLexer(RegexLexer): |
519 class GoodDataCLLexer(RegexLexer): |
505 """ |
520 """ |
506 Lexer for `GoodData-CL |
521 Lexer for `GoodData-CL |