Merge branch '2.0'
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / js / 3rdParty / codemirror / mode / sql / sql.js
CommitLineData
837afb80
TD
1(function(mod) {
2 if (typeof exports == "object" && typeof module == "object") // CommonJS
3 mod(require("../../lib/codemirror"));
4 else if (typeof define == "function" && define.amd) // AMD
5 define(["../../lib/codemirror"], mod);
6 else // Plain browser env
7 mod(CodeMirror);
8})(function(CodeMirror) {
9"use strict";
10
77b7b761
TD
11CodeMirror.defineMode("sql", function(config, parserConfig) {
12 "use strict";
13
14 var client = parserConfig.client || {},
15 atoms = parserConfig.atoms || {"false": true, "true": true, "null": true},
16 builtin = parserConfig.builtin || {},
17 keywords = parserConfig.keywords || {},
18 operatorChars = parserConfig.operatorChars || /^[*+\-%<>!=&|~^]/,
19 support = parserConfig.support || {},
20 hooks = parserConfig.hooks || {},
21 dateSQL = parserConfig.dateSQL || {"date" : true, "time" : true, "timestamp" : true};
22
23 function tokenBase(stream, state) {
24 var ch = stream.next();
25
26 // call hooks from the mime type
27 if (hooks[ch]) {
28 var result = hooks[ch](stream, state);
29 if (result !== false) return result;
30 }
31
837afb80
TD
32 if (support.hexNumber == true &&
33 ((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/))
34 || (ch == "x" || ch == "X") && stream.match(/^'[0-9a-fA-F]+'/))) {
77b7b761 35 // hex
837afb80 36 // ref: http://dev.mysql.com/doc/refman/5.5/en/hexadecimal-literals.html
77b7b761 37 return "number";
837afb80
TD
38 } else if (support.binaryNumber == true &&
39 (((ch == "b" || ch == "B") && stream.match(/^'[01]+'/))
40 || (ch == "0" && stream.match(/^b[01]+/)))) {
77b7b761 41 // bitstring
837afb80 42 // ref: http://dev.mysql.com/doc/refman/5.5/en/bit-field-literals.html
77b7b761
TD
43 return "number";
44 } else if (ch.charCodeAt(0) > 47 && ch.charCodeAt(0) < 58) {
45 // numbers
837afb80
TD
46 // ref: http://dev.mysql.com/doc/refman/5.5/en/number-literals.html
47 stream.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/);
48 support.decimallessFloat == true && stream.eat('.');
77b7b761
TD
49 return "number";
50 } else if (ch == "?" && (stream.eatSpace() || stream.eol() || stream.eat(";"))) {
51 // placeholders
52 return "variable-3";
837afb80 53 } else if (ch == "'" || (ch == '"' && support.doubleQuote)) {
77b7b761 54 // strings
837afb80 55 // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html
77b7b761
TD
56 state.tokenize = tokenLiteral(ch);
57 return state.tokenize(stream, state);
837afb80
TD
58 } else if ((((support.nCharCast == true && (ch == "n" || ch == "N"))
59 || (support.charsetCast == true && ch == "_" && stream.match(/[a-z][a-z0-9]*/i)))
60 && (stream.peek() == "'" || stream.peek() == '"'))) {
61 // charset casting: _utf8'str', N'str', n'str'
62 // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html
63 return "keyword";
77b7b761
TD
64 } else if (/^[\(\),\;\[\]]/.test(ch)) {
65 // no highlightning
66 return null;
837afb80
TD
67 } else if (support.commentSlashSlash && ch == "/" && stream.eat("/")) {
68 // 1-line comment
69 stream.skipToEnd();
70 return "comment";
71 } else if ((support.commentHash && ch == "#")
72 || (ch == "-" && stream.eat("-") && (!support.commentSpaceRequired || stream.eat(" ")))) {
77b7b761 73 // 1-line comments
837afb80 74 // ref: https://kb.askmonty.org/en/comment-syntax/
77b7b761
TD
75 stream.skipToEnd();
76 return "comment";
77 } else if (ch == "/" && stream.eat("*")) {
78 // multi-line comments
837afb80 79 // ref: https://kb.askmonty.org/en/comment-syntax/
77b7b761
TD
80 state.tokenize = tokenComment;
81 return state.tokenize(stream, state);
82 } else if (ch == ".") {
83 // .1 for 0.1
837afb80 84 if (support.zerolessFloat == true && stream.match(/^(?:\d+(?:e[+-]?\d+)?)/i)) {
77b7b761
TD
85 return "number";
86 }
87 // .table_name (ODBC)
837afb80
TD
88 // // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html
89 if (support.ODBCdotTable == true && stream.match(/^[a-zA-Z_]+/)) {
77b7b761
TD
90 return "variable-2";
91 }
92 } else if (operatorChars.test(ch)) {
93 // operators
94 stream.eatWhile(operatorChars);
95 return null;
96 } else if (ch == '{' &&
97 (stream.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/) || stream.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/))) {
98 // dates (weird ODBC syntax)
837afb80 99 // ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html
77b7b761
TD
100 return "number";
101 } else {
102 stream.eatWhile(/^[_\w\d]/);
103 var word = stream.current().toLowerCase();
104 // dates (standard SQL syntax)
837afb80 105 // ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html
77b7b761
TD
106 if (dateSQL.hasOwnProperty(word) && (stream.match(/^( )+'[^']*'/) || stream.match(/^( )+"[^"]*"/)))
107 return "number";
108 if (atoms.hasOwnProperty(word)) return "atom";
109 if (builtin.hasOwnProperty(word)) return "builtin";
110 if (keywords.hasOwnProperty(word)) return "keyword";
111 if (client.hasOwnProperty(word)) return "string-2";
112 return null;
113 }
114 }
115
116 // 'string', with char specified in quote escaped by '\'
117 function tokenLiteral(quote) {
118 return function(stream, state) {
119 var escaped = false, ch;
120 while ((ch = stream.next()) != null) {
121 if (ch == quote && !escaped) {
122 state.tokenize = tokenBase;
123 break;
124 }
125 escaped = !escaped && ch == "\\";
126 }
127 return "string";
128 };
129 }
130 function tokenComment(stream, state) {
131 while (true) {
132 if (stream.skipTo("*")) {
133 stream.next();
134 if (stream.eat("/")) {
135 state.tokenize = tokenBase;
136 break;
137 }
138 } else {
139 stream.skipToEnd();
140 break;
141 }
142 }
143 return "comment";
144 }
145
146 function pushContext(stream, state, type) {
147 state.context = {
148 prev: state.context,
149 indent: stream.indentation(),
150 col: stream.column(),
151 type: type
152 };
153 }
154
155 function popContext(state) {
156 state.indent = state.context.indent;
157 state.context = state.context.prev;
158 }
159
160 return {
161 startState: function() {
162 return {tokenize: tokenBase, context: null};
163 },
164
165 token: function(stream, state) {
166 if (stream.sol()) {
167 if (state.context && state.context.align == null)
168 state.context.align = false;
169 }
170 if (stream.eatSpace()) return null;
171
172 var style = state.tokenize(stream, state);
173 if (style == "comment") return style;
174
175 if (state.context && state.context.align == null)
176 state.context.align = true;
177
178 var tok = stream.current();
179 if (tok == "(")
180 pushContext(stream, state, ")");
181 else if (tok == "[")
182 pushContext(stream, state, "]");
183 else if (state.context && state.context.type == tok)
184 popContext(state);
185 return style;
186 },
187
188 indent: function(state, textAfter) {
189 var cx = state.context;
837afb80
TD
190 if (!cx) return 0;
191 var closing = textAfter.charAt(0) == cx.type;
192 if (cx.align) return cx.col + (closing ? 0 : 1);
193 else return cx.indent + (closing ? 0 : config.indentUnit);
194 },
195
196 blockCommentStart: "/*",
197 blockCommentEnd: "*/",
198 lineComment: support.commentSlashSlash ? "//" : support.commentHash ? "#" : null
77b7b761
TD
199 };
200});
201
202(function() {
203 "use strict";
204
205 // `identifier`
206 function hookIdentifier(stream) {
837afb80
TD
207 // MySQL/MariaDB identifiers
208 // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html
77b7b761
TD
209 var ch;
210 while ((ch = stream.next()) != null) {
211 if (ch == "`" && !stream.eat("`")) return "variable-2";
212 }
213 return null;
214 }
215
216 // variable token
217 function hookVar(stream) {
218 // variables
837afb80
TD
219 // @@prefix.varName @varName
220 // varName can be quoted with ` or ' or "
221 // ref: http://dev.mysql.com/doc/refman/5.5/en/user-variables.html
77b7b761
TD
222 if (stream.eat("@")) {
223 stream.match(/^session\./);
224 stream.match(/^local\./);
225 stream.match(/^global\./);
226 }
227
228 if (stream.eat("'")) {
229 stream.match(/^.*'/);
230 return "variable-2";
231 } else if (stream.eat('"')) {
232 stream.match(/^.*"/);
233 return "variable-2";
234 } else if (stream.eat("`")) {
235 stream.match(/^.*`/);
236 return "variable-2";
237 } else if (stream.match(/^[0-9a-zA-Z$\.\_]+/)) {
238 return "variable-2";
239 }
240 return null;
241 };
242
243 // short client keyword token
244 function hookClient(stream) {
837afb80
TD
245 // \N means NULL
246 // ref: http://dev.mysql.com/doc/refman/5.5/en/null-values.html
247 if (stream.eat("N")) {
248 return "atom";
249 }
77b7b761 250 // \g, etc
837afb80
TD
251 // ref: http://dev.mysql.com/doc/refman/5.5/en/mysql-commands.html
252 return stream.match(/^[a-zA-Z.#!?]/) ? "variable-2" : null;
77b7b761
TD
253 }
254
837afb80 255 // these keywords are used by all SQL dialects (however, a mode can still overwrite it)
77b7b761
TD
256 var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from having in insert into is join like not on or order select set table union update values where ";
257
837afb80 258 // turn a space-separated list into an array
77b7b761
TD
259 function set(str) {
260 var obj = {}, words = str.split(" ");
261 for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
262 return obj;
263 }
264
837afb80 265 // A generic SQL Mode. It's not a standard, it just try to support what is generally supported
77b7b761
TD
266 CodeMirror.defineMIME("text/x-sql", {
267 name: "sql",
268 keywords: set(sqlKeywords + "begin"),
269 builtin: set("bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric"),
270 atoms: set("false true null unknown"),
271 operatorChars: /^[*+\-%<>!=]/,
272 dateSQL: set("date time timestamp"),
837afb80
TD
273 support: set("ODBCdotTable doubleQuote binaryNumber hexNumber")
274 });
275
276 CodeMirror.defineMIME("text/x-mssql", {
277 name: "sql",
278 client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),
279 keywords: set(sqlKeywords + "begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered"),
280 builtin: set("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "),
281 atoms: set("false true null unknown"),
282 operatorChars: /^[*+\-%<>!=]/,
283 dateSQL: set("date datetimeoffset datetime2 smalldatetime datetime time"),
284 hooks: {
285 "@": hookVar
286 }
77b7b761
TD
287 });
288
289 CodeMirror.defineMIME("text/x-mysql", {
290 name: "sql",
291 client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),
837afb80
TD
292 keywords: set(sqlKeywords + "accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group groupby_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),
293 builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),
77b7b761
TD
294 atoms: set("false true null unknown"),
295 operatorChars: /^[*+\-%<>!=&|^]/,
296 dateSQL: set("date time timestamp"),
837afb80 297 support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),
77b7b761
TD
298 hooks: {
299 "@": hookVar,
300 "`": hookIdentifier,
301 "\\": hookClient
302 }
303 });
304
305 CodeMirror.defineMIME("text/x-mariadb", {
306 name: "sql",
307 client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),
837afb80
TD
308 keywords: set(sqlKeywords + "accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),
309 builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),
77b7b761
TD
310 atoms: set("false true null unknown"),
311 operatorChars: /^[*+\-%<>!=&|^]/,
312 dateSQL: set("date time timestamp"),
837afb80 313 support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),
77b7b761
TD
314 hooks: {
315 "@": hookVar,
316 "`": hookIdentifier,
317 "\\": hookClient
318 }
319 });
320
837afb80
TD
321 // the query language used by Apache Cassandra is called CQL, but this mime type
322 // is called Cassandra to avoid confusion with Contextual Query Language
323 CodeMirror.defineMIME("text/x-cassandra", {
324 name: "sql",
325 client: { },
326 keywords: set("use select from using consistency where limit first reversed first and in insert into values using consistency ttl update set delete truncate begin batch apply create keyspace with columnfamily primary key index on drop alter type add any one quorum all local_quorum each_quorum"),
327 builtin: set("ascii bigint blob boolean counter decimal double float int text timestamp uuid varchar varint"),
328 atoms: set("false true"),
329 operatorChars: /^[<>=]/,
330 dateSQL: { },
331 support: set("commentSlashSlash decimallessFloat"),
332 hooks: { }
333 });
334
77b7b761
TD
335 // this is based on Peter Raganitsch's 'plsql' mode
336 CodeMirror.defineMIME("text/x-plsql", {
337 name: "sql",
338 client: set("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),
837afb80
TD
339 keywords: set("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),
340 builtin: set("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),
77b7b761 341 operatorChars: /^[*+\-%<>!=~]/,
837afb80
TD
342 dateSQL: set("date time timestamp"),
343 support: set("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")
344 });
345
346 // Created to support specific hive keywords
347 CodeMirror.defineMIME("text/x-hive", {
348 name: "sql",
349 keywords: set("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"),
350 builtin: set("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),
351 atoms: set("false true null unknown"),
352 operatorChars: /^[*+\-%<>!=]/,
353 dateSQL: set("date timestamp"),
354 support: set("ODBCdotTable doubleQuote binaryNumber hexNumber")
77b7b761
TD
355 });
356}());
837afb80
TD
357
358});
359
360/*
361 How Properties of Mime Types are used by SQL Mode
362 =================================================
363
364 keywords:
365 A list of keywords you want to be highlighted.
366 functions:
367 A list of function names you want to be highlighted.
368 builtin:
369 A list of builtin types you want to be highlighted (if you want types to be of class "builtin" instead of "keyword").
370 operatorChars:
371 All characters that must be handled as operators.
372 client:
373 Commands parsed and executed by the client (not the server).
374 support:
375 A list of supported syntaxes which are not common, but are supported by more than 1 DBMS.
376 * ODBCdotTable: .tableName
377 * zerolessFloat: .1
378 * doubleQuote
379 * nCharCast: N'string'
380 * charsetCast: _utf8'string'
381 * commentHash: use # char for comments
382 * commentSlashSlash: use // for comments
383 * commentSpaceRequired: require a space after -- for comments
384 atoms:
385 Keywords that must be highlighted as atoms,. Some DBMS's support more atoms than others:
386 UNKNOWN, INFINITY, UNDERFLOW, NaN...
387 dateSQL:
388 Used for date/time SQL standard syntax, because not all DBMS's support same temporal types.
389*/