1
0
mirror of https://github.com/cmur2/joe-syntax.git synced 2024-11-18 20:56:17 +01:00
joe-syntax/css.jsf

169 lines
2.7 KiB
Plaintext
Raw Normal View History

# JOE syntax highlight file for CSS
# by Eric Lin
# Define colors
=Idle
=Comment green
2011-11-06 21:03:56 +01:00
=Constant cyan
=Escape bold cyan
=Keyword bold
=Bad bold red
=Class yellow
2011-11-06 20:39:24 +01:00
=Id red
=Tag magenta
=HTML
# from html.jsf to support <?php?>
=TagEdge green
:begin Idle
2011-11-06 20:39:24 +01:00
* begin noeat call=.css()
#
# For <style> in html
#
.subr css
:reset HTML
2011-11-06 20:39:24 +01:00
* reset
"<" maybe_done recolor=-1
"/" slash
# prevent duplicate code
"#.a-zA-Z" selector noeat
"@" command recolor=-1
:maybe_done TagEdge
2011-11-06 20:39:24 +01:00
* reset_html noeat
"/" reset noeat return recolor=-2
.ifdef php
2011-11-06 20:39:24 +01:00
"?%" rtn_php call=php.php()
.endif
# fix needed to produce similar output without php
:reset_html HTML
2011-11-06 20:39:24 +01:00
* reset noeat recolor=-2
# this state allows php and perl to recolor the ?> %> or &> properly.
:rtn_php TagEdge
2011-11-06 20:39:24 +01:00
* 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
2011-11-06 21:03:56 +01:00
# 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
2011-11-06 20:39:24 +01:00
"{" 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
2011-11-06 21:03:56 +01:00
# everything inside "{ ... }", containing many "key: value;" pairs
2011-11-06 20:39:24 +01:00
:style_block Idle
* style_block
"}" reset
"/" maybe_style_comment
"a-zA-Z-" style_word recolor=-1
2011-11-06 20:39:24 +01:00
:maybe_style_comment Idle
* style_block recolor=-1
"*" style_comment recolor=-2
2011-11-06 20:39:24 +01:00
:style_comment Comment
* style_comment
"*" maybe_end_style_comment
2011-11-06 20:39:24 +01:00
:maybe_end_style_comment Comment
* comment
"/" style_block
"*" maybe_end_style_comment
2011-11-06 21:03:56 +01:00
# 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
2011-11-06 21:03:56 +01:00
"#" color recolor=-1
"0-9" decimal recolor=-1
"." maybe_float
2011-11-06 21:03:56 +01:00
"a-zA-Z_" ident
:color Constant
* style_value noeat
"0-9a-fA-F" color
2011-11-06 21:03:56 +01:00
: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
2011-11-06 21:03:56 +01:00
:decimal_unit Constant
* style_value noeat
"a-zA-Z" decimal_unit
:ident Idle
* style_value noeat
"a-ZA-Z0-9_-" ident
.end