GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
Fork of nex3/haml
Description: HTML Abstraction Markup Language - A Markup Haiku
Homepage: http://haml.hamptoncatlin.com
Clone URL: git://github.com/chriseppstein/haml.git
Syntax highlighting for sass-mode
Prathan Thananart (author)
Sat Feb 16 02:31:10 -0800 2008
nex3 (committer)
Sat Feb 16 09:41:17 -0800 2008
commit  ea909f2286ad370c0421c3b373dc5c1ce3644624
tree    6dbdff0416a6535082ba868ccbd93be418baf237
parent  9cadebe3b2c3db6e34f1239f029483c3b46e9785
...
1
2
 
3
4
5
...
7
8
9
10
 
11
12
13
 
14
15
16
...
61
62
63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
65
66
 
67
68
69
...
86
87
88
89
 
 
 
 
 
90
91
92
...
1
 
2
3
4
5
...
7
8
9
 
10
11
12
 
13
14
15
16
...
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
 
106
107
108
109
...
126
127
128
 
129
130
131
132
133
134
135
136
0
@@ -1,5 +1,5 @@
0
 ;;; sass-mode.el -- Major mode for editing Sass files
0
-;;; Version 0.0.1
0
+;;; Version 0.0.2
0
 ;;; Written by Nathan Weizenbaum
0
 
0
 ;;; Because Sass's indentation schema is similar
0
@@ -7,10 +7,10 @@
0
 ;;; functions are similar to those in yaml-mode and python-mode.
0
 
0
 ;;; To install, save this somewhere and add the following to your .emacs file:
0
-;;;
0
+;;;
0
 ;;; (add-to-list 'load-path "/path/to/sass-mode.el")
0
 ;;; (require 'sass-mode nil 't)
0
-;;;
0
+;;;
0
 
0
 ;;; Code:
0
 
0
@@ -61,9 +61,49 @@
0
   "Prepends a Sass-tab-matching regexp to str."
0
   (concat "^\\(" (string-* " " sass-indent-offset) "\\)*" str))
0
 
0
+;; Font lock
0
+
0
+(defconst sass-font-lock-keywords-1
0
+ (list
0
+ ;; directives
0
+ '("^@.*" 0 font-lock-constant-face)
0
+ ;; strings and hex constants
0
+ '("\\(\'[^']*'\\)" 1 font-lock-string-face append)
0
+ '("\\(\"[^\"]*\"\\)" 1 font-lock-string-face append)
0
+ '("\\(#[0-9a-fA-F]\\{3\\}\\{1,2\\}\\>\\)" 1 font-lock-string-face append)
0
+ ;; attributes
0
+ '("\\(:[A-Za-z-]+\\|[A-Za-z-]+:\\)" 0 font-lock-constant-face append)
0
+ ;; constants
0
+ '("![a-z0-9_-]+" 0 font-lock-variable-name-face append)
0
+ ;; comments
0
+ '("^ *\\(/[/*].*\\)$" 1 font-lock-comment-face append)
0
+ ;; ids
0
+ '("\\(?:^\\|,\\) *\\(#[a-z0-9_-]+\/?\\)" 1 font-lock-keyword-face)
0
+ ;; classes
0
+ '("\\(?:^\\|,\\) *\\(\\.[a-z0-9_-]+\/?\\)" 1 font-lock-type-face)
0
+ ;; tags
0
+ '("\\(?:^\\|,\\) *\\(&\\|[a-z0-9_]+\/?\\)" 1 font-lock-function-name-face )
0
+ ;; class after id
0
+ '("\\(?:^\\|,\\) *\\(#[a-z0-9_]+\/?\\)" (1 font-lock-keyword-face)
0
+ ("\\.[a-z0-9_-]+" nil nil (0 font-lock-type-face)))
0
+ ;; class after class
0
+ '("\\(?:^\\|,\\) *\\(\\.[a-z0-9_]+\/?\\)" (1 font-lock-type-face)
0
+ ("\\.[a-z0-9_-]+" nil nil (0 font-lock-type-face)))
0
+ ;; id after class
0
+ '("\\(?:^\\|,\\) *\\(\\.[a-z0-9_]+\/?\\)" (1 font-lock-type-face)
0
+ ("\\#[a-z0-9_-]+" nil nil (0 font-lock-keyword-face)))
0
+ ;; class after tag
0
+ '("\\(?:^\\|,\\) *\\(&\\|[a-z0-9_]+\/?\\)" (1 font-lock-function-name-face)
0
+ ("\\.[a-z0-9_-]+" nil nil (0 font-lock-type-face)))
0
+ ;; id after tag
0
+ '("\\(?:^\\|,\\) *\\(&\\|[a-z0-9_]+\/?\\)" (1 font-lock-function-name-face)
0
+ ("\\#[a-z0-9_-]+" nil nil (0 font-lock-keyword-face)))
0
+ ;; expressions
0
+ '("\\([=]\\)" 0 font-lock-preprocessor-face prepend)))
0
+
0
 ;; Constants
0
 
0
-(defconst sass-mode-version "0.0.1" "Version of `sass-mode.'")
0
+(defconst sass-mode-version "0.0.2" "Version of `sass-mode.'")
0
 
0
 (defconst sass-blank-line-re "^[ \t]*$"
0
   "Regexp matching a line containing only whitespace.")
0
@@ -86,7 +126,11 @@
0
   "Simple mode to edit Sass.
0
 
0
 \\{sass-mode-map}"
0
- (set (make-local-variable 'indent-line-function) 'sass-indent-line))
0
+ (set (make-local-variable 'indent-line-function) 'sass-indent-line)
0
+ (set (make-local-variable 'font-lock-defaults)
0
+ '((sass-font-lock-keywords-1)
0
+ nil
0
+ t)))
0
 
0
 ;; Indentation and electric keys
0
 

Comments

    No one has commented yet.