forked from open-falcon/grafana-openfalcon-datasource
-
Notifications
You must be signed in to change notification settings - Fork 1
/
lexer.js
44 lines (44 loc) · 1.44 KB
/
lexer.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
///<reference path="../../../headers/common.d.ts" />
System.register(['lodash'], function(exports_1) {
var lodash_1;
function Lexer(expression) {
this.input = expression;
}
exports_1("Lexer", Lexer);
return {
setters:[
function (lodash_1_1) {
lodash_1 = lodash_1_1;
}],
execute: function() {
Lexer.prototype = {
tokenize: function () {
var list = [];
var pos = 0;
var split_list = this.input.split("#");
var length = split_list.length;
split_list.map(function(entry, index){
if(entry) {
list.push({
type: "identifier",
value: entry,
pos: pos + 1
});
}
pos += entry.length;
if (index < length - 1) {
list.push({
type: '#',
value: '#',
pos: pos + 1
})
pos += 1;
}
});
return list;
}
};
}
}
});
//# sourceMappingURL=lexer.js.map