tabs to spaces
This commit is contained in:
parent
f2ae785532
commit
1a3bbcbfd4
1 changed files with 82 additions and 78 deletions
|
|
@ -60,96 +60,100 @@ var scadHighlightRules = function() {
|
||||||
|
|
||||||
this.$rules = {
|
this.$rules = {
|
||||||
"start" : [
|
"start" : [
|
||||||
{
|
{
|
||||||
token : "comment",
|
token : "comment",
|
||||||
regex : "\\/\\/.*$"
|
regex : "\\/\\/.*$"
|
||||||
},
|
},
|
||||||
new DocCommentHighlightRules().getStartRule("start"),
|
new DocCommentHighlightRules().getStartRule("start"),
|
||||||
{
|
{
|
||||||
token : "comment", // multi line comment
|
token : "comment", // multi line comment
|
||||||
regex : "\\/\\*",
|
merge : true,
|
||||||
next : "comment"
|
regex : "\\/\\*",
|
||||||
}, {
|
next : "comment"
|
||||||
token : "string", // single line
|
}, {
|
||||||
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
token : "string", // single line
|
||||||
}, {
|
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
||||||
token : "string", // multi line string start
|
}, {
|
||||||
regex : '["].*\\\\$',
|
token : "string", // multi line string start
|
||||||
next : "qqstring"
|
regex : '["].*\\\\$',
|
||||||
}, {
|
next : "qqstring"
|
||||||
token : "string", // single line
|
}, {
|
||||||
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
token : "string", // single line
|
||||||
}, {
|
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
||||||
token : "string", // multi line string start
|
}, {
|
||||||
regex : "['].*\\\\$",
|
token : "string", // multi line string start
|
||||||
next : "qstring"
|
regex : "['].*\\\\$",
|
||||||
}, {
|
next : "qstring"
|
||||||
token : "constant.numeric", // hex
|
}, {
|
||||||
regex : "0[xX][0-9a-fA-F]+\\b"
|
token : "constant.numeric", // hex
|
||||||
}, {
|
regex : "0[xX][0-9a-fA-F]+\\b"
|
||||||
token : "constant.numeric", // float
|
}, {
|
||||||
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
token : "constant.numeric", // float
|
||||||
}, {
|
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
||||||
|
}, {
|
||||||
token : "constant", // <CONSTANT>
|
token : "constant", // <CONSTANT>
|
||||||
regex : "<[a-zA-Z0-9.]+>"
|
regex : "<[a-zA-Z0-9.]+>"
|
||||||
}, {
|
}, {
|
||||||
token : "keyword", // pre-compiler directivs
|
token : "keyword", // pre-compiler directivs
|
||||||
regex : "(?:use|include)"
|
regex : "(?:use|include)"
|
||||||
}, {
|
}, {
|
||||||
token : function(value) {
|
token : function(value) {
|
||||||
if (value == "this")
|
if (value == "this")
|
||||||
return "variable.language";
|
return "variable.language";
|
||||||
else if (keywords.hasOwnProperty(value))
|
else if (keywords.hasOwnProperty(value))
|
||||||
return "keyword";
|
return "keyword";
|
||||||
else if (buildinConstants.hasOwnProperty(value))
|
else if (buildinConstants.hasOwnProperty(value))
|
||||||
return "constant.language";
|
return "constant.language";
|
||||||
else
|
else
|
||||||
return "identifier";
|
return "identifier";
|
||||||
},
|
},
|
||||||
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
||||||
}, {
|
}, {
|
||||||
token : "keyword.operator",
|
token : "keyword.operator",
|
||||||
regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)"
|
regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|new|delete|typeof|void)"
|
||||||
}, {
|
}, {
|
||||||
token : "lparen",
|
token : "lparen",
|
||||||
regex : "[[({]"
|
regex : "[[({]"
|
||||||
}, {
|
}, {
|
||||||
token : "rparen",
|
token : "rparen",
|
||||||
regex : "[\\])}]"
|
regex : "[\\])}]"
|
||||||
}, {
|
}, {
|
||||||
token : "text",
|
token : "text",
|
||||||
regex : "\\s+"
|
regex : "\\s+"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"comment" : [
|
"comment" : [
|
||||||
{
|
{
|
||||||
token : "comment", // closing comment
|
token : "comment", // closing comment
|
||||||
regex : ".*?\\*\\/",
|
regex : ".*?\\*\\/",
|
||||||
next : "start"
|
next : "start"
|
||||||
}, {
|
}, {
|
||||||
token : "comment", // comment spanning whole line
|
token : "comment", // comment spanning whole line
|
||||||
regex : ".+"
|
merge : true,
|
||||||
}
|
regex : ".+"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"qqstring" : [
|
"qqstring" : [
|
||||||
{
|
{
|
||||||
token : "string",
|
token : "string",
|
||||||
regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
|
regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
|
||||||
next : "start"
|
next : "start"
|
||||||
}, {
|
}, {
|
||||||
token : "string",
|
token : "string",
|
||||||
regex : '.+'
|
merge : true,
|
||||||
}
|
regex : '.+'
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"qstring" : [
|
"qstring" : [
|
||||||
{
|
{
|
||||||
token : "string",
|
token : "string",
|
||||||
regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
|
regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
|
||||||
next : "start"
|
next : "start"
|
||||||
}, {
|
}, {
|
||||||
token : "string",
|
token : "string",
|
||||||
regex : '.+'
|
merge : true,
|
||||||
}
|
regex : '.+'
|
||||||
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue