Initial OCaml support (integers and real literals, comments)

This commit is contained in:
Ivan Sokolov
2016-12-08 18:11:56 +03:00
parent 11e9419258
commit 57960bdc81
2 changed files with 20 additions and 25 deletions

View File

@@ -1766,7 +1766,7 @@ func runtimeSyntaxObjcMicro() (*asset, error) {
return a, nil
}
var _runtimeSyntaxOcamlMicro = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x7c\x92\xd1\x6e\xd4\x4a\x0c\x86\xef\xf7\x29\x46\xd3\x73\xb1\xad\xce\x02\xe2\x0e\x89\x82\x78\x0d\x9a\x82\xbc\x33\x4e\x62\x70\x3c\x2b\x8f\xd3\x6c\x16\xf3\xee\x28\x09\x8b\xa8\x40\x5c\x25\x91\xfe\xff\xb3\xf5\x39\x75\x16\x83\x73\x88\x25\xc1\xc0\x31\xc4\xe6\xc5\xc0\xf4\xfe\xbf\xb8\xbb\x19\x29\xef\x52\xe1\xa2\x41\x31\x87\xd8\xbc\x7d\xf8\x70\xf8\xf8\xf8\xf0\xea\xf0\x06\x0e\x97\xcf\x8f\xdf\x5e\xff\xff\xbd\x79\x17\x77\x37\x19\x13\x83\x82\x51\x91\xfa\xb3\xd0\x29\xa2\x2c\x95\x3d\xa3\xf9\x13\xb0\x0f\x68\x7d\xc9\x4e\xe2\x20\xd9\x15\x93\x9f\x94\x9e\xc0\xd0\x9f\x48\x6d\x04\xf6\x54\xa4\x9a\x02\x89\xdd\xae\xd8\x6a\x3a\x26\x1b\x15\x03\x19\x0e\xf5\xf9\x2a\x7b\x9b\x4f\xe8\xe5\x84\xe2\x89\xa1\x56\x1f\x4a\x1e\x19\x1d\xcf\x09\x4f\xcb\x26\x8e\x67\x43\x15\xe0\x0d\x76\x02\x5b\x3e\xaf\x94\x23\x8f\xb8\x62\xda\x51\xbc\x1d\x25\xad\x95\xf5\xa5\xa8\x0f\x60\xa9\x77\xd3\xd9\x27\xb2\xfe\x39\xe0\x30\x94\x4c\x2d\xa1\x5e\x51\x33\x32\x97\x69\x85\x41\xf5\xa9\x47\xf1\xd2\x2e\x9d\xb0\xbb\x49\x45\x32\xfd\xee\x25\xcd\xb0\x69\xa1\xd6\x6d\x89\x22\x57\xdc\x06\x1c\xb9\xa4\x6b\x6c\x80\x0e\xc5\x60\x4d\x1e\xb1\x23\x71\x94\xec\xe5\xf8\x05\x93\xf9\xe6\xc5\x2b\x75\xde\x16\xf5\xa9\x27\x46\xcf\xc5\x73\x11\x74\x5b\x9e\x93\x58\xd9\xa0\xab\x53\x10\xc3\x3f\x0f\x63\x3a\xa2\xb7\xf0\x6b\xfe\x26\xb0\xbe\x5c\x75\xfe\x25\x4f\x92\x78\xcc\xe8\x24\x3d\x2a\x99\x93\x90\x11\x30\x5d\x50\x37\x00\x9e\x4f\x1a\xfe\x61\x47\x70\x72\xc5\xd6\x87\xd1\xe0\xc8\xe8\x0c\x97\xd9\x97\x59\x6a\xae\x40\xd7\x3d\x52\x19\x06\x14\xbb\x02\xa6\x9e\x0c\x43\x35\x50\xbb\x8f\xcd\xbe\xb9\x8b\x01\x25\xdf\xc7\xe6\xae\xb9\xdd\x7e\x12\x92\xae\x86\xbd\x94\x30\x8c\x6c\xc4\x24\x18\x7a\x90\xcc\x24\x5d\x98\xd1\x6e\xaf\x27\x57\xea\x7a\x3b\x32\xa4\xaf\x21\xc6\x87\x4f\x4d\x7c\xbc\x8b\x71\xf7\x23\x00\x00\xff\xff\xa9\x3c\xab\x7f\xff\x02\x00\x00")
var _runtimeSyntaxOcamlMicro = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xac\x8e\x4f\x4b\xc4\x30\x14\xc4\xef\xf9\x14\x8f\x17\x0f\xbb\x95\x94\x7a\x12\x0f\x4b\x71\xfd\x83\x5e\x5c\xf1\x24\x24\x41\xde\xa6\x51\x0a\xf9\x23\x4d\x84\xee\xb7\x97\x46\x2d\x82\xb8\xb2\xe0\x21\x61\xc2\xcc\x2f\x33\x69\x17\x32\x8d\x80\xd1\x90\x77\x08\xa8\x6a\xef\xfa\xf6\x08\x19\xe3\x70\xf7\xe6\xb7\x76\x48\x8c\x73\xb8\x0d\xd9\xbe\x7c\x68\x0e\xeb\x3e\xd0\xb0\x63\x26\xba\x38\x80\x89\x21\x65\x0a\xb9\x0e\x25\x0d\x28\xda\x46\x6e\xd7\x5a\x36\x27\xd3\x79\xd2\x15\x16\x68\x63\x32\xb9\x7d\x4c\xdc\x68\xd9\x88\xd3\x72\xcd\xd4\xa5\x35\xbd\xdf\xc7\xa9\x4e\xaa\x6e\x8e\xdf\xd8\x91\xba\xbf\x90\x46\x8e\x8f\x53\xcb\x19\x89\xe7\x73\x71\xfd\x4d\x7e\xfe\x03\x0f\x96\xdc\x61\xf5\xf5\x97\x58\x48\x7b\xa5\xe5\xb1\xd0\x3f\x9c\x65\xfb\x5f\x1b\xeb\xdf\x8c\x85\x7c\xbd\x2f\xe5\x07\x93\xd3\x38\xc6\xe1\x22\x7a\x6f\x43\x4e\xf3\xb0\xf2\x84\x94\x69\xc8\x2b\x54\x0b\x55\x21\xd8\xd0\xad\x50\x55\x6a\x89\xec\x3d\x00\x00\xff\xff\x0b\x52\x29\x30\x3d\x02\x00\x00")
func runtimeSyntaxOcamlMicroBytes() ([]byte, error) {
return bindataRead(

View File

@@ -1,25 +1,20 @@
syntax "ocaml" "\.mli?$"
#uid
color red "\<[A-Z][0-9a-z_]{2,}\>"
#declarations
color green "\<(let|val|method|in|and|rec|private|virtual|constraint)\>"
#structure items
color red "\<(type|open|class|module|exception|external)\>"
#patterns
color blue "\<(fun|function|functor|match|try|with)\>"
#patterns-modifiers
color yellow "\<(as|when|of)\>"
#conditions
color cyan "\<(if|then|else)\>"
#blocs
color magenta "\<(begin|end|object|struct|sig|for|while|do|done|to|downto)\>"
#constantes
color green "\<(true|false)\>"
#modules/classes
color green "\<(include|inherit|initializer)\>"
#expr modifiers
color yellow "\<(new|ref|mutable|lazy|assert|raise)\>"
#comments
color white start="\(\*" end="\*\)"
#strings (no multiline handling yet)
color brightblack ""[^\"]*""
# Numbers
## Integers
### Binary
color constant.number "-?0[bB][01][01_]*"
### Octal
color constant.number "-?0[oO][0-7][0-7_]*"
### Decimal
color constant.number "-?\d[\d_]*"
### Hexadecimal
color constant.number "-?0[xX][0-9a-fA-F][0-9a-fA-F_]*"
## Real
### Decimal
color constant.number "-?\d[\d_]*.\d[\d_]*([eE][+-]\d[\d_]*.\d[\d_]*)?"
### Hexadecimal
color constant.number "-?0[xX][0-9a-fA-F][0-9a-fA-F_]*.[0-9a-fA-F][0-9a-fA-F_]*([pP][+-][0-9a-fA-F][0-9a-fA-F_]*.[0-9a-fA-F][0-9a-fA-F_]*)?"
# Comments
color comment start="\(\*" end="\*\)"