Skip to content

Commit

Permalink
It's unnecessary to manually specify regexp for strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
jart committed Apr 14, 2013
1 parent be60c13 commit 26ae74b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions coffee-mode.el
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -380,9 +380,6 @@ called `coffee-compiled-buffer-name'."
;; Define Language Syntax ;; Define Language Syntax
;; ;;


;; String literals
(defvar coffee-string-regexp "\"\\([^\\]\\|\\\\.\\)*?\"\\|'\\([^\\]\\|\\\\.\\)*?'")

;; Instance variables (implicit this) ;; Instance variables (implicit this)
(defvar coffee-this-regexp "@\\w+\\|this") (defvar coffee-this-regexp "@\\w+\\|this")


Expand Down Expand Up @@ -444,15 +441,14 @@ called `coffee-compiled-buffer-name'."
;; *Note*: order below matters. `coffee-keywords-regexp' goes last ;; *Note*: order below matters. `coffee-keywords-regexp' goes last
;; because otherwise the keyword "state" in the function ;; because otherwise the keyword "state" in the function
;; "state_entry" would be highlighted. ;; "state_entry" would be highlighted.
`((,coffee-string-regexp . font-lock-string-face) `((,coffee-this-regexp . font-lock-variable-name-face)
(,coffee-this-regexp . font-lock-variable-name-face)
(,coffee-prototype-regexp . font-lock-variable-name-face) (,coffee-prototype-regexp . font-lock-variable-name-face)
(,coffee-assign-regexp . font-lock-type-face) (,coffee-assign-regexp . font-lock-type-face)
(,coffee-local-assign-regexp 1 font-lock-variable-name-face) (,coffee-local-assign-regexp 1 font-lock-variable-name-face)
(,coffee-boolean-regexp . font-lock-constant-face) (,coffee-boolean-regexp . font-lock-constant-face)
(,coffee-lambda-regexp 2 font-lock-function-name-face) (,coffee-lambda-regexp 2 font-lock-function-name-face)
(,coffee-keywords-regexp 1 font-lock-keyword-face)) (,coffee-keywords-regexp 1 font-lock-keyword-face)
(,coffee-string-interpolation-regexp 0 font-lock-variable-name-face t)) (,coffee-string-interpolation-regexp 0 font-lock-variable-name-face t)))


;; ;;
;; Helper Functions ;; Helper Functions
Expand Down

0 comments on commit 26ae74b

Please sign in to comment.