Fixed boolean constants and null.
This commit is contained in:
parent
58db794e8e
commit
24fb491b95
1 changed files with 5 additions and 14 deletions
|
|
@ -11,11 +11,6 @@ var PowershellHighlightRules = function() {
|
|||
("function|if|else|elseif|switch|while|default|for|do|until|break|continue|foreach|return|filter|in|trap|throw|param|begin|process|end").split("|")
|
||||
);
|
||||
|
||||
var buildinConstants = lang.arrayToMap(
|
||||
("$Null|$True|$False").split("|")
|
||||
);
|
||||
|
||||
|
||||
// regexp must not have capturing parentheses. Use (?:) instead.
|
||||
// regexps are ordered -> the first match is used
|
||||
|
||||
|
|
@ -24,9 +19,6 @@ var PowershellHighlightRules = function() {
|
|||
{
|
||||
token : "comment",
|
||||
regex : "#.*$"
|
||||
}, {
|
||||
token : "string.regexp",
|
||||
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
||||
}, {
|
||||
token : "string", // single line
|
||||
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
||||
|
|
@ -41,15 +33,14 @@ var PowershellHighlightRules = function() {
|
|||
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
||||
}, {
|
||||
token : "constant.language.boolean",
|
||||
regex : "(?:true|false)\\b"
|
||||
regex : "[$](?:[Tt]rue|[Ff]alse)\\b"
|
||||
}, {
|
||||
token : "constant.language.boolean",
|
||||
regex : "[$][Nn]ull\\b"
|
||||
}, {
|
||||
token : function(value) {
|
||||
if (value == "this")
|
||||
return "variable.language";
|
||||
else if (keywords.hasOwnProperty(value))
|
||||
if (keywords.hasOwnProperty(value))
|
||||
return "keyword";
|
||||
else if (buildinConstants.hasOwnProperty(value))
|
||||
return "constant.language";
|
||||
else
|
||||
return "identifier";
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue