-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmode-fenia.js
119 lines (98 loc) · 3.28 KB
/
mode-fenia.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
const ace = require('ace-builds');
require('ace-builds/webpack-resolver')
require('ace-builds/src-noconflict/mode-javascript')
require('ace-builds/src-noconflict/worker-javascript')
ace.define('ace/mode/fenia', function(acequire, exports, module) {
var oop = acequire("../lib/oop");
var JavaScriptMode = acequire("./javascript").Mode;
var FeniaHighlightRules = acequire("./fenia_highlight_rules").FeniaHighlightRules;
var Mode = function() {
JavaScriptMode.call(this);
this.HighlightRules = FeniaHighlightRules;
};
oop.inherits(Mode, JavaScriptMode);
(function() {
this.createWorker = function(session) {
return null;
};
this.$id = "ace/mode/fenia";
}).call(Mode.prototype);
exports.Mode = Mode;
});
ace.define('ace/mode/fenia_highlight_rules', function(acequire, exports, module) {
var oop = acequire("../lib/oop");
var DocCommentHighlightRules = acequire("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = acequire("./text_highlight_rules").TextHighlightRules;
var FeniaHighlightRules = function() {
var keywords = (
"null|if|else|for|break|continue|return|function|var|try|catch|throw"
);
var buildinConstants = (
"null"
);
var langClasses = (
"Map|RegList"
);
// TODO var importClasses = "";
var keywordMapper = this.createKeywordMapper({
"variable.language": "this",
"keyword": keywords,
"support.function": langClasses,
"constant.language": buildinConstants
}, "identifier");
this.$rules = {
"start" : [
{
token : "comment",
regex : "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
regex : "\\/\\*",
next : "comment"
}, {
token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, {
token : "string", // single line
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, {
token : "constant.numeric",
regex : "[0-9a-fA-F]+\\b"
}, {
token : "constant.language.boolean",
regex : "(?:true|false)\\b"
}, {
token : keywordMapper,
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, {
token : "keyword.operator",
regex : "!|%|&|\\*|\\-|\\+|~|==|=|!=|<=|>=|<|>|&&|\\|\\|"
}, {
token : "lparen",
regex : "[[({]"
}, {
token : "rparen",
regex : "[\\])}]"
}, {
token : "text",
regex : "\\s+"
}
],
"comment" : [
{
token : "comment", // closing comment
regex : "\\*\\/",
next : "start"
}, {
defaultToken : "comment"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
};
oop.inherits(FeniaHighlightRules, TextHighlightRules);
exports.FeniaHighlightRules = FeniaHighlightRules;
});