9
if (typeof exports == "object" && typeof module == "object")
10
mod(require("../../lib/codemirror"), require("../../addon/mode/simple"));
11
else if (typeof define == "function" && define.amd)
12
define(["../../lib/codemirror", "../../addon/mode/simple"], mod);
15
})(function(CodeMirror) {
18
CodeMirror.defineSimpleMode("factor", {
22
{regex: /#?!.*/, token: "comment"},
24
{regex: /"""/, token: "string", next: "string3"},
25
{regex: /(STRING:)(\s)/, token: ["keyword", null], next: "string2"},
26
{regex: /\S*?"/, token: "string", next: "string"},
28
{regex: /(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\-?\d+.?\d*)(?=\s)/, token: "number"},
31
{regex: /((?:GENERIC)|\:?\:)(\s+)(\S+)(\s+)(\()/, token: ["keyword", null, "def", null, "bracket"], next: "stack"},
33
{regex: /(M\:)(\s+)(\S+)(\s+)(\S+)/, token: ["keyword", null, "def", null, "tag"]},
35
{regex: /USING\:/, token: "keyword", next: "vocabulary"},
37
{regex: /(USE\:|IN\:)(\s+)(\S+)(?=\s|$)/, token: ["keyword", null, "tag"]},
39
{regex: /(\S+\:)(\s+)(\S+)(?=\s|$)/, token: ["keyword", null, "def"]},
41
{regex: /(?:;|\\|t|f|if|loop|while|until|do|PRIVATE>|<PRIVATE|\.|\S*\[|\]|\S*\{|\})(?=\s|$)/, token: "keyword"},
43
{regex: /\S+[\)>\.\*\?]+(?=\s|$)/, token: "builtin"},
44
{regex: /[\)><]+\S+(?=\s|$)/, token: "builtin"},
46
{regex: /(?:[\+\-\=\/\*<>])(?=\s|$)/, token: "keyword"},
48
{regex: /\S+/, token: "variable"},
49
{regex: /\s+|./, token: null}
52
{regex: /;/, token: "keyword", next: "start"},
53
{regex: /\S+/, token: "tag"},
54
{regex: /\s+|./, token: null}
57
{regex: /(?:[^\\]|\\.)*?"/, token: "string", next: "start"},
58
{regex: /.*/, token: "string"}
61
{regex: /^;/, token: "keyword", next: "start"},
62
{regex: /.*/, token: "string"}
65
{regex: /(?:[^\\]|\\.)*?"""/, token: "string", next: "start"},
66
{regex: /.*/, token: "string"}
69
{regex: /\)/, token: "bracket", next: "start"},
70
{regex: /--/, token: "bracket"},
71
{regex: /\S+/, token: "meta"},
72
{regex: /\s+|./, token: null}
79
dontIndentStates: ["start", "vocabulary", "string", "string3", "stack"],
84
CodeMirror.defineMIME("text/x-factor", "factor");