Permalink
Browse files

better regexps, @blah: and {blah: true, blah2:true}

  • Loading branch information...
1 parent eee29e0 commit 88e7b95c8b6855f41fa4d9271df1dfa690678d3c @defunkt committed Mar 7, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 coffee-mode.el
View
@@ -99,12 +99,12 @@ print the compiled JavaScript.")
;; Define Language Syntax
;;
-;; Assignment
-(defvar coffee-type-regexp ".+?:")
-
;; Instance variables (implicit this)
(defvar coffee-constant-regexp "@\\w*\\|this")
+;; Assignment
+(defvar coffee-type-regexp "\\(\\w\\|\\.\\|_\\|$\\)+?:")
+
;; Booleans
(defvar coffee-functions-regexp "\\b\\(true\\|false\\|yes\\|no\\|on\\|off\\)\\b")
@@ -141,8 +141,8 @@ print the compiled JavaScript.")
;; Each class of keyword is given a particular face
(defvar coffee-font-lock-keywords
`(
- (,coffee-type-regexp . font-lock-type-face)
(,coffee-constant-regexp . font-lock-variable-name-face)
+ (,coffee-type-regexp . font-lock-type-face)
(,coffee-event-regexp . font-lock-builtin-face)
(,coffee-functions-regexp . font-lock-constant-face)
(,coffee-keywords-regexp . font-lock-keyword-face)

0 comments on commit 88e7b95

Please sign in to comment.