add some new types and change the type of existing keywords
This commit is contained in:
parent
0216e8bbfd
commit
fcb4023e52
3 changed files with 14 additions and 6 deletions
|
|
@ -38,8 +38,7 @@ var SqlHighlightRules = function() {
|
|||
|
||||
var keywords = (
|
||||
"select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|" +
|
||||
"when|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|" +
|
||||
"foreign|not|references|default|null"
|
||||
"when|else|end|type|left|right|join|on|outer|desc|asc|union|create|table"
|
||||
);
|
||||
|
||||
var builtinConstants = (
|
||||
|
|
@ -51,15 +50,14 @@ var SqlHighlightRules = function() {
|
|||
);
|
||||
|
||||
var dataTypes = (
|
||||
"int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|" +
|
||||
"money|real|number"
|
||||
"int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|timestamp|" +
|
||||
"money|real|number|integer|timezone|smallint"
|
||||
);
|
||||
|
||||
var keywordMapper = this.createKeywordMapper({
|
||||
"support.function": builtinFunctions,
|
||||
"keyword": keywords,
|
||||
"constant.language": builtinConstants,
|
||||
"storage.type": dataTypes
|
||||
"constant.language": builtinConstants
|
||||
}, "identifier", true);
|
||||
|
||||
this.$rules = {
|
||||
|
|
@ -91,6 +89,9 @@ var SqlHighlightRules = function() {
|
|||
}, {
|
||||
token : "paren.rparen",
|
||||
regex : "[\\)]"
|
||||
}, {
|
||||
token : "keyword.keyword",
|
||||
regex : "(primary key)|if|(foreign key)|not|references|default|null|set|(drop database)|(drop table)"
|
||||
}, {
|
||||
token : "text",
|
||||
regex : "\\s+"
|
||||
|
|
|
|||
7
lib/ace/snippets/mask.js
Normal file
7
lib/ace/snippets/mask.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
exports.snippetText = require("../requirejs/text!./mask.snippets");
|
||||
exports.scope = "mask";
|
||||
|
||||
});
|
||||
0
lib/ace/snippets/mask.snippets
Normal file
0
lib/ace/snippets/mask.snippets
Normal file
Loading…
Add table
Add a link
Reference in a new issue