corrade-nucleus-nucleons – Blame information for rev
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
2 | office | 1 | define("ace/mode/sql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { |
2 | "use strict"; |
||
3 | |||
4 | var oop = require("../lib/oop"); |
||
5 | var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; |
||
6 | |||
7 | var SqlHighlightRules = function() { |
||
8 | |||
9 | var keywords = ( |
||
10 | "select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|" + |
||
11 | "when|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|" + |
||
12 | "foreign|not|references|default|null|inner|cross|natural|database|drop|grant" |
||
13 | ); |
||
14 | |||
15 | var builtinConstants = ( |
||
16 | "true|false" |
||
17 | ); |
||
18 | |||
19 | var builtinFunctions = ( |
||
20 | "avg|count|first|last|max|min|sum|ucase|lcase|mid|len|round|rank|now|format|" + |
||
21 | "coalesce|ifnull|isnull|nvl" |
||
22 | ); |
||
23 | |||
24 | var dataTypes = ( |
||
25 | "int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|" + |
||
26 | "money|real|number|integer" |
||
27 | ); |
||
28 | |||
29 | var keywordMapper = this.createKeywordMapper({ |
||
30 | "support.function": builtinFunctions, |
||
31 | "keyword": keywords, |
||
32 | "constant.language": builtinConstants, |
||
33 | "storage.type": dataTypes |
||
34 | }, "identifier", true); |
||
35 | |||
36 | this.$rules = { |
||
37 | "start" : [ { |
||
38 | token : "comment", |
||
39 | regex : "--.*$" |
||
40 | }, { |
||
41 | token : "comment", |
||
42 | start : "/\\*", |
||
43 | end : "\\*/" |
||
44 | }, { |
||
45 | token : "string", // " string |
||
46 | regex : '".*?"' |
||
47 | }, { |
||
48 | token : "string", // ' string |
||
49 | regex : "'.*?'" |
||
50 | }, { |
||
51 | token : "constant.numeric", // float |
||
52 | regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" |
||
53 | }, { |
||
54 | token : keywordMapper, |
||
55 | regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" |
||
56 | }, { |
||
57 | token : "keyword.operator", |
||
58 | regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" |
||
59 | }, { |
||
60 | token : "paren.lparen", |
||
61 | regex : "[\\(]" |
||
62 | }, { |
||
63 | token : "paren.rparen", |
||
64 | regex : "[\\)]" |
||
65 | }, { |
||
66 | token : "text", |
||
67 | regex : "\\s+" |
||
68 | } ] |
||
69 | }; |
||
70 | this.normalizeRules(); |
||
71 | }; |
||
72 | |||
73 | oop.inherits(SqlHighlightRules, TextHighlightRules); |
||
74 | |||
75 | exports.SqlHighlightRules = SqlHighlightRules; |
||
76 | }); |
||
77 | |||
78 | define("ace/mode/sql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sql_highlight_rules"], function(require, exports, module) { |
||
79 | "use strict"; |
||
80 | |||
81 | var oop = require("../lib/oop"); |
||
82 | var TextMode = require("./text").Mode; |
||
83 | var SqlHighlightRules = require("./sql_highlight_rules").SqlHighlightRules; |
||
84 | |||
85 | var Mode = function() { |
||
86 | this.HighlightRules = SqlHighlightRules; |
||
87 | this.$behaviour = this.$defaultBehaviour; |
||
88 | }; |
||
89 | oop.inherits(Mode, TextMode); |
||
90 | |||
91 | (function() { |
||
92 | |||
93 | this.lineCommentStart = "--"; |
||
94 | |||
95 | this.$id = "ace/mode/sql"; |
||
96 | }).call(Mode.prototype); |
||
97 | |||
98 | exports.Mode = Mode; |
||
99 | |||
100 | }); |