mirror of
https://github.com/cmur2/joe-syntax.git
synced 2024-12-11 05:04:28 +01:00
CSS: rewrite selector parser frm scratch for more modularity
This commit is contained in:
parent
78dda67321
commit
0109cc7c7d
65
css.jsf
65
css.jsf
@ -10,7 +10,7 @@
|
||||
=Keyword bold
|
||||
=Bad bold red
|
||||
|
||||
=Class cyan
|
||||
=Class yellow
|
||||
=Id red
|
||||
=Tag magenta
|
||||
=HTML
|
||||
@ -31,9 +31,9 @@
|
||||
* reset
|
||||
"<" maybe_done recolor=-1
|
||||
"/" slash
|
||||
"#" id_block recolor=-1
|
||||
"." class_block recolor=-1
|
||||
"a-zA-Z" tag_block recolor=-1
|
||||
# prevent duplicate code
|
||||
"#.a-zA-Z" selector noeat
|
||||
"@" command recolor=-1
|
||||
|
||||
:maybe_done TagEdge
|
||||
* reset_html noeat
|
||||
@ -63,31 +63,44 @@
|
||||
"/" reset
|
||||
"*" maybe_end_comment
|
||||
|
||||
:command Idle
|
||||
* command
|
||||
";" reset
|
||||
"{" command_block
|
||||
|
||||
:command_block Idle
|
||||
* command_block
|
||||
"}" reset
|
||||
|
||||
# CSS selectors
|
||||
:id_block Id
|
||||
* id_block
|
||||
" " id_block_reset
|
||||
: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_block_reset Idle
|
||||
* id_block
|
||||
"a-zA-Z" tag_block recolor=-1
|
||||
"." class_block recolor=-1
|
||||
"#" id_block recolor=-1
|
||||
"{" style_block recolor=-1
|
||||
|
||||
:class_block Class
|
||||
* class_block
|
||||
" " tag_block
|
||||
"{" style_block recolor=-1
|
||||
|
||||
:tag_block Tag
|
||||
* tag_block
|
||||
"{" style_block recolor=-1
|
||||
"," tag_sep recolor=-1
|
||||
|
||||
:tag_sep Idle
|
||||
* tag_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
|
||||
|
Loading…
Reference in New Issue
Block a user