From d7093479d0ce6ea109c1c8faa3f42ef89918dd9f Mon Sep 17 00:00:00 2001 From: neoneye Date: Tue, 22 Mar 2005 11:13:31 +0000 Subject: [PATCH] I noticed that RegExp.$3 wasn't colored correct. The '3' was colored as it were a number.. in this context its an instance variable. I added a rule to recognize instance variables. git-svn-id: http://macromates.com/svn/Bundles/trunk/JavaScript.tmbundle@526 dfb7d73b-c2ec-0310-8fea-fb051d288c6d --- Syntaxes/JavaScript.plist | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Syntaxes/JavaScript.plist b/Syntaxes/JavaScript.plist index cd5436c..e755b2d 100644 --- a/Syntaxes/JavaScript.plist +++ b/Syntaxes/JavaScript.plist @@ -21,8 +21,25 @@ { name = "keywords.js"; foregroundColor = "#CC7833"; match = "\\<(this|typeof|new|true|false|undefined|null|for|in|break|continue|while|do|function|return|if|else|case|switch|var)\\>"; }, { name = "constants.numeric.js"; match = "\\<((0(x|X)[0-9a-fA-F]+)|([0-9]+(\\.[0-9]+)?))\\>"; foregroundColor = "#3387CC"; }, - { name = "keywords.functions.js"; match = "(\\<|\\.)([a-zA-Z_]\\w*(?=\s*\\())"; - "foregroundColor[2]" = "#CC3833"; + { + /* + Methods: + obj.method(arguments) + */ + name = "keywords.functions.js"; + match = "(\\<|\\.)([a-zA-Z_]\\w*(?=\\s*\\())"; + "foregroundColor[2]" = "#CC3833"; + }, + + { + /* + Instance Variables: + RegExp.$3 + ary.lengh + */ + name = "keywords.instance-variables.js"; + match = "\\.([a-zA-Z_]\\w*|\\$\\d{1,2})(?!\\s*\\()"; + "foregroundColor[1]" = "#779938"; }, { name = "strings.single-quoted.js"; begin = "'"; end = "'"; swallow = "\\\\."; foregroundColor = "#66CC33"; },