Fixed boolean constants and null.

This commit is contained in:
John Kane 2011-09-30 00:14:00 +01:00
commit 24fb491b95

View file

@ -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";
},