-
Notifications
You must be signed in to change notification settings - Fork 17
/
css.jsf
168 lines (133 loc) · 2.72 KB
/
css.jsf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# JOE syntax highlight file for CSS
# by Eric Lin
# Define colors
=Idle
=Comment green
=Constant cyan
=Escape bold cyan
=Keyword bold
=Bad bold red
=Class yellow
=Id red
=Tag magenta
=HTML
# from html.jsf to support <?php?>
=TagEdge green
:begin Idle
* begin noeat call=.css()
#
# For <style> in html
#
.subr css
:reset HTML
* reset
"<" maybe_done recolor=-1
"/" slash
# prevent duplicate code
"#.a-zA-Z" selector noeat
"@" command recolor=-1
:maybe_done TagEdge
* reset_html noeat
"/" reset noeat return recolor=-2
.ifdef php
"?%" rtn_php call=php.php()
.endif
# fix needed to produce similar output without php
:reset_html HTML
* reset noeat recolor=-2
# this state allows php and perl to recolor the ?> %> or &> properly.
:rtn_php TagEdge
* reset noeat
:slash Idle
* reset noeat
"*" comment recolor=-2
:comment Comment
* comment
"*" maybe_end_comment
:maybe_end_comment Comment
* comment
"/" reset
"*" maybe_end_comment
:command Idle
* command
";" reset
"{" command_block
:command_block Idle
* command_block
"}" reset
# CSS selectors
:selector Idle
* selector
"#" id_sel recolor=-1
"." class_sel recolor=-1
"a-zA-Z" tag_sel recolor=-1
":" pseudo_class_sel recolor=-1
"{" style_block recolor=-1
:id_sel Id
* selector noeat
"a-zA-Z0-9_-" id_sel
:class_sel Class
* selector noeat
"a-zA-Z0-9_-" class_sel
:tag_sel Tag
* selector noeat
"a-zA-Z0-9_-" tag_sel
"[" tag_sel_attr recolor=-1
:tag_sel_attr Idle
* tag_sel_attr
"]" selector
:pseudo_class_sel Idle
* selector noeat
"a-zA-Z0-9_-" pseudo_class_sel
# everything inside "{ ... }", containing many "key: value;" pairs
:style_block Idle
* style_block
"}" reset
"/" maybe_style_comment
"a-zA-Z-" style_word recolor=-1
:maybe_style_comment Idle
* style_block recolor=-1
"*" style_comment recolor=-2
:style_comment Comment
* style_comment
"*" maybe_end_style_comment
:maybe_end_style_comment Comment
* comment
"/" style_block
"*" maybe_end_style_comment
# property-key
:style_word Keyword
* style_word
":" style_value recolor=-1
# property-value
:style_value Idle
* style_value
";" style_block
# treat } without previous ; like ;}
"}" style_block noeat
"#" color recolor=-1
"0-9" decimal recolor=-1
"." maybe_float
"a-zA-Z_" ident
:color Constant
* style_value noeat
"0-9a-fA-F" color
:decimal Constant
* style_value noeat
"0-9" decimal
"." float
"a-zA-Z%" decimal_unit
:maybe_float Constant
* style_value noeat recolor=-2
"0-9" float recolor=-2
:float Constant
* style_value noeat
"0-9" float
"a-zA-Z%" decimal_unit
:decimal_unit Constant
* style_value noeat
"a-zA-Z" decimal_unit
:ident Idle
* style_value noeat
"a-ZA-Z0-9_-" ident
.end