Removed unused code; Added missing keywords; Added defaultToken
This commit is contained in:
parent
34ceb4e15e
commit
76230003b6
1 changed files with 11 additions and 18 deletions
|
|
@ -38,18 +38,19 @@ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||||
var DHighlightRules = function() {
|
var DHighlightRules = function() {
|
||||||
|
|
||||||
var keywords = (
|
var keywords = (
|
||||||
"this|super|import|module|body|mixin|__traits|invariant|alias|asm|delete|typeof|typeid|sizeof|cast|new|in"
|
"this|super|import|module|body|mixin|__traits|invariant|alias|asm|delete|"+
|
||||||
|
"typeof|typeid|sizeof|cast|new|in|is|typedef|__vector|__parameters"
|
||||||
);
|
);
|
||||||
|
|
||||||
var keywordControls = (
|
var keywordControls = (
|
||||||
"break|case|continue|default|do|else|for|foreach|foreach_reverse|goto|if|" +
|
"break|case|continue|default|do|else|for|foreach|foreach_reverse|goto|if|" +
|
||||||
"return|switch|while|catch|try|throw|finally|version"
|
"return|switch|while|catch|try|throw|finally|version|assert|unittest|with"
|
||||||
);
|
);
|
||||||
|
|
||||||
var types = (
|
var types = (
|
||||||
"auto|bool|char|dchar|wchar|byte|ubyte|" +
|
"auto|bool|char|dchar|wchar|byte|ubyte|float|double|real|" +
|
||||||
"cfloat|creal|cdouble|cent|ifloat|ireal|idouble|" +
|
"cfloat|creal|cdouble|cent|ifloat|ireal|idouble|" +
|
||||||
"int|long|short|void|uint|ulong|ushort|" +
|
"int|long|short|void|uint|ulong|ushort|ucent|" +
|
||||||
"function|delegate|string|wstring|dstring|size_t|ptrdiff_t|hash_t|Object"
|
"function|delegate|string|wstring|dstring|size_t|ptrdiff_t|hash_t|Object"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -60,7 +61,7 @@ var DHighlightRules = function() {
|
||||||
);
|
);
|
||||||
|
|
||||||
var storages = (
|
var storages = (
|
||||||
"class|struct|union|template|interface|enum"
|
"class|struct|union|template|interface|enum|macro"
|
||||||
);
|
);
|
||||||
|
|
||||||
var stringEscapesSeq = {
|
var stringEscapesSeq = {
|
||||||
|
|
@ -94,10 +95,6 @@ var DHighlightRules = function() {
|
||||||
"constant.language": builtinConstants
|
"constant.language": builtinConstants
|
||||||
}, "identifier");
|
}, "identifier");
|
||||||
|
|
||||||
var paramsTokensFunc = function(grp) {
|
|
||||||
console.log(grp);
|
|
||||||
};
|
|
||||||
|
|
||||||
var identifierRe = "[a-zA-Z_\u00a1-\uffff][a-zA-Z\\d_\u00a1-\uffff]*\\b";
|
var identifierRe = "[a-zA-Z_\u00a1-\uffff][a-zA-Z\\d_\u00a1-\uffff]*\\b";
|
||||||
|
|
||||||
// regexp must not have capturing parentheses. Use (?:) instead.
|
// regexp must not have capturing parentheses. Use (?:) instead.
|
||||||
|
|
@ -197,8 +194,7 @@ var DHighlightRules = function() {
|
||||||
regex : ".*?\\*\\/",
|
regex : ".*?\\*\\/",
|
||||||
next : "start"
|
next : "start"
|
||||||
}, {
|
}, {
|
||||||
token : "comment", // comment spanning whole line
|
defaultToken: 'comment'
|
||||||
regex : ".+"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"plus-comment" : [
|
"plus-comment" : [
|
||||||
|
|
@ -207,8 +203,7 @@ var DHighlightRules = function() {
|
||||||
regex : ".*?\\+\\/",
|
regex : ".*?\\+\\/",
|
||||||
next : "start"
|
next : "start"
|
||||||
}, {
|
}, {
|
||||||
token : "comment", // comment spanning whole line
|
defaultToken: 'comment'
|
||||||
regex : ".+"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
@ -219,8 +214,7 @@ var DHighlightRules = function() {
|
||||||
regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"[cdw]?',
|
regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"[cdw]?',
|
||||||
next : "start"
|
next : "start"
|
||||||
}, {
|
}, {
|
||||||
token : "string",
|
defaultToken: 'string'
|
||||||
regex : '.+'
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
@ -231,8 +225,7 @@ var DHighlightRules = function() {
|
||||||
regex : '(?:(?:\\\\.)|(?:[^`\\\\]))*?`[cdw]?',
|
regex : '(?:(?:\\\\.)|(?:[^`\\\\]))*?`[cdw]?',
|
||||||
next : "start"
|
next : "start"
|
||||||
}, {
|
}, {
|
||||||
token : "string",
|
defaultToken: 'string'
|
||||||
regex : '.+'
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
@ -328,7 +321,7 @@ var DHighlightRules = function() {
|
||||||
DHighlightRules.metaData = {
|
DHighlightRules.metaData = {
|
||||||
comment: 'D language',
|
comment: 'D language',
|
||||||
fileTypes: [ 'd', 'di' ],
|
fileTypes: [ 'd', 'di' ],
|
||||||
firstLineMatch: '^#!.*\\bg?dmd\\b.',
|
firstLineMatch: '^#!.*\\b[glr]?dmd\\b.',
|
||||||
foldingStartMarker: '(?x)/\\*\\*(?!\\*)|^(?![^{]*?//|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|//|/\\*(?!.*?\\*/.*\\S))',
|
foldingStartMarker: '(?x)/\\*\\*(?!\\*)|^(?![^{]*?//|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|//|/\\*(?!.*?\\*/.*\\S))',
|
||||||
foldingStopMarker: '(?<!\\*)\\*\\*/|^\\s*\\}',
|
foldingStopMarker: '(?<!\\*)\\*\\*/|^\\s*\\}',
|
||||||
keyEquivalent: '^~D',
|
keyEquivalent: '^~D',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue