diff options
author | gbrandl <devnull@localhost> | 2007-08-15 10:28:01 +0200 |
---|---|---|
committer | gbrandl <devnull@localhost> | 2007-08-15 10:28:01 +0200 |
commit | 4ebe90449791dc502d7df8e24c2370413c417f4a (patch) | |
tree | 62948510c1c9c01b30f2e94b8232a84030108af2 | |
parent | 39524fd1a9125958e072590acdc7b955bf2e174a (diff) | |
download | pygments-4ebe90449791dc502d7df8e24c2370413c417f4a.tar.gz |
[svn] Fix last commit.
-rw-r--r-- | pygments/lexers/compiled.py | 92 | ||||
-rw-r--r-- | pygments/lexers/functional.py | 2 |
2 files changed, 1 insertions, 93 deletions
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py index fd192d75..493aaca5 100644 --- a/pygments/lexers/compiled.py +++ b/pygments/lexers/compiled.py @@ -883,98 +883,6 @@ class DylanLexer(RegexLexer): } -class OcamlLexer(RegexLexer): - """ - For the OCaml language. - - *New in Pygments 0.7.* - """ - - name = 'OCaml' - aliases = ['ocaml'] - filenames = ['*.ml', '*.mli', '*.mll', '*.mly'] - mimetypes = ['text/x-ocaml'] - - keywords = [ - 'as', 'assert', 'begin', 'class', 'constraint', 'do', 'done', - 'downto', 'else', 'end', 'exception', 'external', 'false', - 'for', 'fun', 'function', 'functor', 'if', 'in', 'include', - 'inherit', 'initializer', 'lazy', 'let', 'match', 'method', - 'module', 'mutable', 'new', 'object', 'of', 'open', 'private', - 'raise', 'rec', 'sig', 'struct', 'then', 'to', 'true', 'try', - 'type', 'val', 'virtual', 'when', 'while', 'with' - ] - keyopts = [ - '!=','#','&','&&','\(','\)','\*','\+',',','-', - '-\.','->','\.','\.\.',':','::',':=',':>',';',';;','<', - '<-','=','>','>]','>}','\?','\?\?','\[','\[<','\[>','\[\|', - ']','_','`','{','{<','\|','\|]','}','~' - ] - - operators = r'[!$%&*+\./:<=>?@^|~-]' - word_operators = ['and', 'asr', 'land', 'lor', 'lsl', 'lxor', 'mod', 'or'] - prefix_syms = r'[!?~]' - infix_syms = r'[=<>@^|&+\*/$%-]' - primitives = ['unit', 'int', 'float', 'bool', 'string', 'char', 'list', 'array'] - - tokens = { - 'escape-sequence': [ - (r'\\[\"\'ntbr]', String.Escape), - (r'\\[0-9]{3}', String.Escape), - (r'\\x[0-9a-fA-F]{2}', String.Escape), - ], - 'root': [ - (r'\s+', Text), - (r'false|true|\(\)|\[\]', Name.Builtin.Pseudo), - (r'\b([A-Z][A-Za-z0-9_\']*)(?=\s*\.)', - Name.Namespace, 'dotted'), - (r'\b([A-Z][A-Za-z0-9_\']*)', Name.Class), - (r'\(\*', Comment, 'comment'), - (r'\b(%s)\b' % '|'.join(keywords), Keyword), - (r'(%s)' % '|'.join(keyopts), Operator), - (r'(%s|%s)?%s' % (infix_syms, prefix_syms, operators), Operator), - (r'\b(%s)\b' % '|'.join(word_operators), Operator.Word), - (r'\b(%s)\b' % '|'.join(primitives), Keyword.Type), - - (r"[^\W\d][\w']*", Name), - - (r'\d[\d_]*', Number.Integer), - (r'0[xX][\da-fA-F][\da-fA-F_]*', Number.Hex), - (r'0[oO][0-7][0-7_]*', Number.Oct), - (r'0[bB][01][01_]*', Number.Binary), - (r'-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)', Number.Float), - - (r"'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'", - String.Char), - (r"'.'", String.Char), - (r"'", Keyword), # a stray quote is another syntax element - - (r'"', String.Double, 'string'), - - (r'[~?][a-z][\w\']*:', Name.Variable), - ], - 'comment': [ - (r'[^(*)]', Comment), - (r'\(\*', Comment, '#push'), - (r'\*\)', Comment, '#pop'), - (r'[(*)]', Comment), - ], - 'string': [ - (r'[^\\"]', String.Double), - include('escape-sequence'), - (r'\\\n', String.Double), - (r'"', String.Double, '#pop'), - ], - 'dotted': [ - (r'\s+', Text), - (r'\.', Punctuation), - (r'[A-Z][A-Za-z0-9_\']*(?=\s*\.)', Name.Namespace), - (r'[A-Z][A-Za-z0-9_\']*', Name.Class, '#pop'), - (r'[a-z][a-z0-9_\']*', Name, '#pop'), - ], - } - - class ObjectiveCLexer(RegexLexer): """ For Objective-C source code with preprocessor directives. diff --git a/pygments/lexers/functional.py b/pygments/lexers/functional.py index 8bd4afff..64e826cb 100644 --- a/pygments/lexers/functional.py +++ b/pygments/lexers/functional.py @@ -21,7 +21,7 @@ from pygments.token import Text, Comment, Operator, Keyword, Name, \ String, Number, Punctuation -__all__ = ['SchemeLexer', 'HaskellLexer', 'OCamlLexer'] +__all__ = ['SchemeLexer', 'HaskellLexer', 'OcamlLexer'] class SchemeLexer(RegexLexer): |