Permalink
Browse files

Regular expressions

  • Loading branch information...
1 parent 9efc880 commit 5ca4229349591f2353b22cb30a3f7a75cb20d05a @defunkt committed Mar 7, 2010
Showing with 8 additions and 4 deletions.
  1. +8 −4 coffee-mode.el
View
@@ -22,10 +22,9 @@
coffee-js-keywords
coffee-cs-keywords) 'words))
-(setq coffee-types '(""))
-(defvar coffee-type-regexp (regexp-opt coffee-types 'words))
+(setq coffee-type-regexp "\\b.+:")
-(defvar coffee-constant-regexp "")
+(setq coffee-constant-regexp "@\\w+")
(setq coffee-events '(""))
(defvar coffee-event-regexp (regexp-opt coffee-events 'words))
@@ -35,7 +34,7 @@
;; create the list for font-lock.
;; each class of keyword is given a particular face
-(defvar coffee-font-lock-keywords
+(setq coffee-font-lock-keywords
`(
(,coffee-type-regexp . font-lock-type-face)
(,coffee-constant-regexp . font-lock-constant-face)
@@ -76,6 +75,11 @@ For detail, see `comment-dwim'."
(modify-syntax-entry ?' "\"" coffee-mode-syntax-table)
(modify-syntax-entry ?' "\"" coffee-mode-syntax-table)
+ ;; regular expressions
+ (modify-syntax-entry ?/ "\"" coffee-mode-syntax-table)
+ (modify-syntax-entry ?/ "\"" coffee-mode-syntax-table)
+
+ ;; comments
(setq comment-start "#")
;; clear memory

0 comments on commit 5ca4229

Please sign in to comment.