Skip to content

Commit 314692f

Browse files
committed
changed countsamp definition
1 parent cceb08c commit 314692f

File tree

1 file changed

+114
-113
lines changed

1 file changed

+114
-113
lines changed

lib/ace/mode/gmql_highlight_rules.js

+114-113
Original file line numberDiff line numberDiff line change
@@ -28,131 +28,132 @@
2828
*
2929
* ***** END LICENSE BLOCK ***** */
3030

31-
define(function(require, exports, module) {
32-
"use strict";
31+
define(function (require, exports, module) {
32+
"use strict";
3333

34-
var oop = require("../lib/oop");
35-
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
34+
var oop = require("../lib/oop");
35+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
3636

37-
var GmqlHighlightRules = function() {
37+
var GmqlHighlightRules = function () {
3838

39-
var keywords = (
40-
"select|project|extend|group|merge|order" //relational unary operations
41-
+ "|sort" // ?do we have? //relational unary operations
42-
+ "|union|difference" //relational binary operations
43-
+ "|cover|flat|summit|histogram|map|join" //domain specific operations
44-
+ "|materialize" //utility operations
45-
);
39+
var keywords = (
40+
"select|project|extend|group|merge|order" //relational unary operations
41+
+ "|sort" // ?do we have? //relational unary operations
42+
+ "|union|difference" //relational binary operations
43+
+ "|cover|flat|summit|histogram|map|join" //domain specific operations
44+
+ "|materialize" //utility operations
45+
);
4646

47-
var builtinConstants = (
48-
"true|false|distance|mindist|mindistance|dle|dge|md|any|all|start|stop|chr|strand|left|right|up|down|downstream|upstream"
49-
+ "|and|or|not|as|in|allbut"
50-
+ "|count|bag|sum|avg|min|max|median|std"
51-
+ "|cat|contig"
52-
+ "|dist|dg|dg|bagd|dl|sqrt"
53-
+ "|left_distinct|right_distinct|both"
54-
);
47+
var builtinConstants = (
48+
"true|false|distance|mindist|mindistance|dle|dge|md|any|all|start|stop|chr|strand|left|right|up|down|downstream|upstream"
49+
+ "|and|or|not|as|in|allbut"
50+
+ "|count|bag|sum|avg|min|max|median|std"
51+
+ "|countsamp"
52+
53+
+ "|cat|contig"
54+
+ "|dist|dg|dg|bagd|dl|sqrt"
55+
+ "|left_distinct|right_distinct|both"
56+
);
5557

56-
var builtinFunctions = (
57-
"region|semijoin" // SELECT
58-
+ "|metadata|region_update|metadata_update" // PROJECT
59-
+ "|meta_aggregate|region_group|region_aggregate" //GROUP
60-
+ "|groupby" // MERGE
61-
+ "|desc|meta_top|meta_topg|region_order|region_top|region_topg|" // ORDER
62-
+ "|groupby" // MERGE
63-
+ "|joinby" //DIFFERENCE
64-
+ "|aggregate" //COVER(flat/summit/histogram
65-
+ "|output" //JOIN
58+
var builtinFunctions = (
59+
"region|semijoin" // SELECT
60+
+ "|metadata|region_update|metadata_update" // PROJECT
61+
+ "|meta_aggregate|region_group|region_aggregate" //GROUP
62+
+ "|groupby" // MERGE
63+
+ "|desc|meta_top|meta_topg|region_order|region_top|region_topg|" // ORDER
64+
+ "|groupby" // MERGE
65+
+ "|joinby" //DIFFERENCE
66+
+ "|aggregate" //COVER(flat/summit/histogram
67+
+ "|output" //JOIN
6668
+ "|into" //MATERIALIZE
67-
+ "|countsamp"
68-
//+ "|parser|region_modifier|meta_modifier|meta_project"
69-
);
69+
//+ "|parser|region_modifier|meta_modifier|meta_project"
70+
);
7071

71-
var dataTypes = (
72-
"int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|" +
73-
"money|real|number|integer"
74-
);
72+
var dataTypes = (
73+
"int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|" +
74+
"money|real|number|integer"
75+
);
7576

76-
var keywordMapper = this.createKeywordMapper({
77-
"support.function": builtinFunctions,
78-
"keyword": keywords,
79-
"constant.language": builtinConstants,
80-
"storage.type": dataTypes
81-
}, "identifier", true);
77+
var keywordMapper = this.createKeywordMapper({
78+
"support.function": builtinFunctions,
79+
"keyword": keywords,
80+
"constant.language": builtinConstants,
81+
"storage.type": dataTypes
82+
}, "identifier", true);
8283

83-
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
84-
"u[0-9a-fA-F]{4}|" + // unicode
85-
"[0-2][0-7]{0,2}|" + // oct
86-
"3[0-6][0-7]?|" + // oct
87-
"37[0-7]?|" + // oct
88-
"[4-7][0-7]?|" + //oct
89-
".)";
84+
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
85+
"u[0-9a-fA-F]{4}|" + // unicode
86+
"[0-2][0-7]{0,2}|" + // oct
87+
"3[0-6][0-7]?|" + // oct
88+
"37[0-7]?|" + // oct
89+
"[4-7][0-7]?|" + //oct
90+
".)";
9091

91-
this.$rules = {
92-
"start" : [ {
93-
token : "comment",
94-
regex : "#.*$"
95-
}, {
96-
token : "string",
97-
regex : "'(?=.)",
98-
next : "qstring"
99-
}, {
100-
token : "string",
101-
regex : '"(?=.)',
102-
next : "qqstring"
103-
}, {
104-
token : "constant.numeric", // float
105-
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
106-
}, {
107-
token : keywordMapper,
108-
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
109-
}, {
110-
token : "keyword.operator",
111-
regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=|,|;|:"
112-
}, {
113-
token : "paren.lparen",
114-
regex : "[\\(]"
115-
}, {
116-
token : "paren.rparen",
117-
regex : "[\\)]"
118-
}, {
119-
token : "text",
120-
regex : "\\s+"
121-
} ],
122-
"qqstring" : [ {
123-
token : "constant.language.escape",
124-
regex : escapedRe
125-
}, {
126-
token : "string",
127-
regex : "\\\\$",
128-
next : "qqstring"
129-
}, {
130-
token : "string",
131-
regex : '"|$',
132-
next : "no_regex"
133-
}, {
134-
defaultToken: "string"
135-
}],
136-
"qstring" : [ {
137-
token : "constant.language.escape",
138-
regex : escapedRe
139-
}, {
140-
token : "string",
141-
regex : "\\\\$",
142-
next : "qstring"
143-
}, {
144-
token : "string",
145-
regex : "'|$",
146-
next : "no_regex"
147-
}, {
148-
defaultToken: "string"
149-
}]
92+
this.$rules = {
93+
"start": [{
94+
token: "comment",
95+
regex: "#.*$"
96+
}, {
97+
token: "string",
98+
regex: "'(?=.)",
99+
next: "qstring"
100+
}, {
101+
token: "string",
102+
regex: '"(?=.)',
103+
next: "qqstring"
104+
}, {
105+
token: "constant.numeric", // float
106+
regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
107+
}, {
108+
token: keywordMapper,
109+
regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
110+
}, {
111+
token: "keyword.operator",
112+
regex: "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=|,|;|:"
113+
}, {
114+
token: "paren.lparen",
115+
regex: "[\\(]"
116+
}, {
117+
token: "paren.rparen",
118+
regex: "[\\)]"
119+
}, {
120+
token: "text",
121+
regex: "\\s+"
122+
}],
123+
"qqstring": [{
124+
token: "constant.language.escape",
125+
regex: escapedRe
126+
}, {
127+
token: "string",
128+
regex: "\\\\$",
129+
next: "qqstring"
130+
}, {
131+
token: "string",
132+
regex: '"|$',
133+
next: "no_regex"
134+
}, {
135+
defaultToken: "string"
136+
}],
137+
"qstring": [{
138+
token: "constant.language.escape",
139+
regex: escapedRe
140+
}, {
141+
token: "string",
142+
regex: "\\\\$",
143+
next: "qstring"
144+
}, {
145+
token: "string",
146+
regex: "'|$",
147+
next: "no_regex"
148+
}, {
149+
defaultToken: "string"
150+
}]
151+
};
152+
this.normalizeRules();
150153
};
151-
this.normalizeRules();
152-
};
153154

154-
oop.inherits(GmqlHighlightRules, TextHighlightRules);
155+
oop.inherits(GmqlHighlightRules, TextHighlightRules);
155156

156-
exports.GmqlHighlightRules = GmqlHighlightRules;
157+
exports.GmqlHighlightRules = GmqlHighlightRules;
157158
});
158159

0 commit comments

Comments
 (0)