Sha256: 230176406d032496dc1565e96e5572e054d770b7dbf796a177c81fed943e3c7b
Contents?: true
Size: 1.48 KB
Versions: 3
Compression:
Stored size: 1.48 KB
Contents
CodeMirror.defineMode("ocaml",function(){function e(e,o){var i=(e.sol(),e.next());if('"'===i)return o.tokenize=r,o.tokenize(e,o);if("("===i&&e.eat("*"))return o.commentLevel++,o.tokenize=t,o.tokenize(e,o);if("~"===i)return e.eatWhile(/\w/),"variable-2";if("`"===i)return e.eatWhile(/\w/),"quote";if(/\d/.test(i))return e.eatWhile(/[\d]/),e.eat(".")&&e.eatWhile(/[\d]/),"number";if(/[+\-*&%=<>!?|]/.test(i))return"operator";e.eatWhile(/\w/);var d=e.current();return n[d]||"variable"}function r(r,t){for(var n,o=!1,i=!1;null!=(n=r.next());){if('"'===n&&!i){o=!0;break}i=!i&&"\\"===n}return o&&!i&&(t.tokenize=e),"string"}function t(r,t){for(var n,o;t.commentLevel>0&&null!=(o=r.next());)"("===n&&"*"===o&&t.commentLevel++,"*"===n&&")"===o&&t.commentLevel--,n=o;return t.commentLevel<=0&&(t.tokenize=e),"comment"}var n={"true":"atom","false":"atom",let:"keyword",rec:"keyword","in":"keyword",of:"keyword",and:"keyword",succ:"keyword","if":"keyword",then:"keyword","else":"keyword","for":"keyword",to:"keyword","while":"keyword","do":"keyword",done:"keyword",fun:"keyword","function":"keyword",val:"keyword",type:"keyword",mutable:"keyword",match:"keyword","with":"keyword","try":"keyword",raise:"keyword",begin:"keyword",end:"keyword",open:"builtin",trace:"builtin",ignore:"builtin",exit:"builtin",print_string:"builtin",print_endline:"builtin"};return{startState:function(){return{tokenize:e,commentLevel:0}},token:function(e,r){return e.eatSpace()?null:r.tokenize(e,r)}}}),CodeMirror.defineMIME("text/x-ocaml","ocaml");
Version data entries
3 entries across 3 versions & 1 rubygems