-
Notifications
You must be signed in to change notification settings - Fork 0
/
AceLanguageConfig.js
49 lines (41 loc) · 1.27 KB
/
AceLanguageConfig.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
// Currently this file only can be pasted to https://ace.c9.io/tool/mode_creator.html
define(function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var RioHighlightRules = function() {
var keywords = (
"value|is|function|of|do|end|if|then|else|use|from|expose"
);
var keywordMapper = this.createKeywordMapper({
"keyword": keywords,
}, "identifier", false);
this.$rules = {
"start" : [ {
token : "string", // " string
regex : '".*?"'
}, {
token : "constant.numeric", // float
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
}, {
token : keywordMapper,
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, {
token : "paren.lparen",
regex : "[\\(]"
}, {
token : "paren.rparen",
regex : "[\\)]"
}, {
token : "text",
regex : "\\s+"
}, {
token: "comment",
regex: ";.*;"
} ]
};
this.normalizeRules();
};
oop.inherits(RioHighlightRules, TextHighlightRules);
exports.RioHighlightRules = RioHighlightRules;
});