parent
4c84db1504
commit
3e091b5b9a
|
@ -23,6 +23,8 @@ class OcamlGrammar(Grammar):
|
||||||
|
|
||||||
PatternRule(r'linenum', r'#[0-9]+ *(?:"(?:[^"\\]|\\[0-9]{3}|\\x[0-9A-Za-z]{2}|\\.)*")?'),
|
PatternRule(r'linenum', r'#[0-9]+ *(?:"(?:[^"\\]|\\[0-9]{3}|\\x[0-9A-Za-z]{2}|\\.)*")?'),
|
||||||
|
|
||||||
|
PatternRule(r'delimiter', r"[()]"),
|
||||||
|
|
||||||
PatternRule(r'keyword', r"(?:with|while|when|virtual|val|type|try|true|to|then|struct|sig|rec|private|parser|or|open|of|object|new|mutable|module|mod|method|match|lxor|lsr|lsl|lor|let|lazy|land|initializer|inherti|include|in|if|functor|function|fun|for|false|external|exception|end|else|downto|done|do|constraint|class|begin|asr|assert|as|and)(?!['a-zA-Z0-9_])"),
|
PatternRule(r'keyword', r"(?:with|while|when|virtual|val|type|try|true|to|then|struct|sig|rec|private|parser|or|open|of|object|new|mutable|module|mod|method|match|lxor|lsr|lsl|lor|let|lazy|land|initializer|inherti|include|in|if|functor|function|fun|for|false|external|exception|end|else|downto|done|do|constraint|class|begin|asr|assert|as|and)(?!['a-zA-Z0-9_])"),
|
||||||
|
|
||||||
PatternRule(r'builtin', r"(?:int|char|string|float|bool|false|true|unit|exn|array|list|option|int32|int64|nativeint|format4|lazy_t)(?!['a-zA-Z0-9_])"),
|
PatternRule(r'builtin', r"(?:int|char|string|float|bool|false|true|unit|exn|array|list|option|int32|int64|nativeint|format4|lazy_t)(?!['a-zA-Z0-9_])"),
|
||||||
|
@ -54,10 +56,10 @@ class OcamlGrammar(Grammar):
|
||||||
|
|
||||||
class Ocaml(mode2.Fundamental):
|
class Ocaml(mode2.Fundamental):
|
||||||
grammar = OcamlGrammar
|
grammar = OcamlGrammar
|
||||||
#opentokens = ('delimiter',)
|
opentokens = ('delimiter',)
|
||||||
#opentags = {'(': ')'}
|
opentags = {'(': ')'}
|
||||||
#closetokens = ('delimiter',)
|
closetokens = ('delimiter',)
|
||||||
#closetags = {')': '('}
|
closetags = {')': '('}
|
||||||
colors = {
|
colors = {
|
||||||
'comment.start': ('red', 'default'),
|
'comment.start': ('red', 'default'),
|
||||||
'comment.null': ('red', 'default'),
|
'comment.null': ('red', 'default'),
|
||||||
|
@ -85,8 +87,8 @@ class Ocaml(mode2.Fundamental):
|
||||||
}
|
}
|
||||||
def __init__(self, w):
|
def __init__(self, w):
|
||||||
mode2.Fundamental.__init__(self, w)
|
mode2.Fundamental.__init__(self, w)
|
||||||
#self.add_bindings('close-paren', (')',))
|
self.add_bindings('close-paren', (')',))
|
||||||
#self.add_bindings('close-brace', ('}',))
|
self.add_bindings('close-brace', ('}',))
|
||||||
#self.add_bindings('close-bracket', (']',))
|
self.add_bindings('close-bracket', (']',))
|
||||||
def name(self):
|
def name(self):
|
||||||
return "Ocaml"
|
return "Ocaml"
|
||||||
|
|
Loading…
Reference in New Issue