diff options
author | rengolin <devnull@localhost> | 2011-09-23 22:29:58 +0100 |
---|---|---|
committer | rengolin <devnull@localhost> | 2011-09-23 22:29:58 +0100 |
commit | f43e41666f743f82d7cfab9c1710bd77029a6ca1 (patch) | |
tree | 53e819ad4e31760268e77ddac58cc36f70e6b4b7 /pygments/lexers/other.py | |
parent | cea3a6803108bb6a0754fb11c76223a8cd0c4fdd (diff) | |
download | pygments-f43e41666f743f82d7cfab9c1710bd77029a6ca1.tar.gz |
Adding preliminary ECL lexer
Diffstat (limited to 'pygments/lexers/other.py')
-rw-r--r-- | pygments/lexers/other.py | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/pygments/lexers/other.py b/pygments/lexers/other.py index e73154aa..6d7bf08d 100644 --- a/pygments/lexers/other.py +++ b/pygments/lexers/other.py @@ -27,7 +27,7 @@ __all__ = ['SqlLexer', 'MySqlLexer', 'SqliteConsoleLexer', 'BrainfuckLexer', 'NewspeakLexer', 'GherkinLexer', 'AsymptoteLexer', 'PostScriptLexer', 'AutohotkeyLexer', 'GoodDataCLLexer', 'MaqlLexer', 'ProtoBufLexer', 'HybrisLexer', 'AwkLexer', - 'Cfengine3Lexer'] + 'Cfengine3Lexer', 'ECLLexer'] line_re = re.compile('.*?\n') @@ -219,6 +219,62 @@ class MySqlLexer(RegexLexer): } +class ECLLexer(RegexLexer): + """ + Lexer for the declarative big-data `ECL <http://hpccsystems.com/community/docs/ecl-language-reference/html>`_ + language. + + *New in Pygments 0.7.* + """ + name = 'ECL' + aliases = ['ecl'] + filenames = ['*.ecl'] + mimetypes = ['application/x-ecl'] + + flags = re.IGNORECASE + + tokens = { + 'root': [ + include('whitespace'), + include('statements'), + ], + 'whitespace': [ + (r'\s+', Text), + (r'//(\n|(.|\n)*?[^\\]\n)', Comment.Single), + (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline), + ], + 'statements': [ + include('types'), + include('keywords'), + (r'"', String, 'string'), + (r'\'', String, 'string'), + (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*', Number.Float), + (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float), + (r'0x[0-9a-fA-F]+[LlUu]*', Number.Hex), + (r'0[0-7]+[LlUu]*', Number.Oct), + (r'\d+[LlUu]*', Number.Integer), + (r'\*/', Error), + (r'[~!%^&*+=|?:<>/-]+', Operator), + (r'[{}()\[\],.;]', Punctuation), + ('[a-zA-Z_][a-zA-Z0-9_]*', Name), + ], + 'types': [ + (r'(STRING|INTEGER|UNSIGNED)\d+', Keyword.Type), + (r'(REAL)', Keyword.Type), + ], + 'keywords': [ + (r'(DATASET|OUTPUT|INDEX|BUILD|SEQUENTIAL|TABLE)', Keyword.Reserved), + (r'(OVERRITE|FLAT)', Keyword.Reserved), + (r'(RECORD|END)', Keyword.Declaration), + ], + 'string': [ + (r'"', String, '#pop'), + (r'\'', String, '#pop'), + ], + } + + + class SqliteConsoleLexer(Lexer): """ Lexer for example sessions using sqlite3. |