CSS: implement constant parser

This commit is contained in:
cn 2011-11-06 21:03:56 +01:00
parent fac5b4bee6
commit ac6cf0fc1b
1 changed files with 37 additions and 9 deletions

46
css.jsf
View File

@ -5,10 +5,14 @@
=Idle =Idle
=Comment green =Comment green
=Constant cyan
=Escape bold cyan
=Keyword bold
=Bad bold red
=Class cyan =Class cyan
=Id red =Id red
=Tag magenta =Tag magenta
=Keyword bold
=HTML =HTML
# from html.jsf to support <?php?> # from html.jsf to support <?php?>
@ -59,6 +63,7 @@
"/" reset "/" reset
"*" maybe_end_comment "*" maybe_end_comment
# CSS selectors
:id_block Id :id_block Id
* id_block * id_block
" " id_block_reset " " id_block_reset
@ -84,20 +89,13 @@
:tag_sep Idle :tag_sep Idle
* tag_block recolor=-1 * tag_block recolor=-1
# everything inside "{ ... }", containing many "key: value;" pairs
:style_block Idle :style_block Idle
* style_block * style_block
"}" reset "}" reset
"/" maybe_style_comment "/" maybe_style_comment
"a-zA-Z-" style_word recolor=-1 "a-zA-Z-" style_word recolor=-1
:style_word Keyword
* style_word
":" style_value recolor=-1
:style_value Idle
* style_value
";" style_block
:maybe_style_comment Idle :maybe_style_comment Idle
* style_block recolor=-1 * style_block recolor=-1
"*" style_comment recolor=-2 "*" style_comment recolor=-2
@ -111,4 +109,34 @@
"/" style_block "/" style_block
"*" maybe_end_style_comment "*" maybe_end_style_comment
# property-key
:style_word Keyword
* style_word
":" style_value recolor=-1
# property-value
:style_value Idle
* style_value
";" style_block
"#" color recolor=-1
"-0-9" decimal recolor=-1
"a-zA-Z_" ident
:color Constant
* style_value noeat
"0-9a-f" color
:decimal Constant
* style_value noeat
"0-9" decimal
"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 .end