From 24fb491b95e2dfc32de9ea48841b2478d536b417 Mon Sep 17 00:00:00 2001 From: John Kane Date: Fri, 30 Sep 2011 00:14:00 +0100 Subject: [PATCH] Fixed boolean constants and null. --- lib/ace/mode/powershell_highlight_rules.js | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/lib/ace/mode/powershell_highlight_rules.js b/lib/ace/mode/powershell_highlight_rules.js index 2703d8b7..5c5bcbf4 100644 --- a/lib/ace/mode/powershell_highlight_rules.js +++ b/lib/ace/mode/powershell_highlight_rules.js @@ -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"; },