mirror of
https://github.com/cmur2/joe-syntax.git
synced 2025-08-31 05:13:04 +02:00
New highlighter for Ruby's ERB and HTML embedded ERB
Ruby code inside ERB tags (whether in plain or HTML environment) is highlighted via the ruby.jsf colorer.
This commit is contained in:
18
ruby.jsf
18
ruby.jsf
@@ -27,11 +27,13 @@
|
||||
# Detect pod
|
||||
|
||||
:idle Idle
|
||||
* rest noeat
|
||||
* NULL noeat call=.ruby()
|
||||
"=" pod_start
|
||||
|
||||
# Rest of line
|
||||
|
||||
.subr ruby
|
||||
|
||||
:rest Idle
|
||||
* rest
|
||||
"#" line_comment recolor=-1
|
||||
@@ -59,7 +61,16 @@
|
||||
:after_term Idle
|
||||
* rest noeat
|
||||
" \t)" after_term
|
||||
.ifdef erb
|
||||
"/" rest
|
||||
"%" after_term_erb_end
|
||||
.else
|
||||
"/%" rest
|
||||
.endif
|
||||
|
||||
:after_term_erb_end Idle
|
||||
* rest noeat
|
||||
">" NULL recolor=-2 return
|
||||
|
||||
:pod_start Idle
|
||||
* pod_start
|
||||
@@ -430,6 +441,9 @@ done
|
||||
* match noeat
|
||||
" \t" after_term noeat
|
||||
"xrqQw" match
|
||||
.ifdef erb
|
||||
">" NULL recolor=-2 return
|
||||
.endif
|
||||
|
||||
:match Idle
|
||||
* inmatch save_c recolor=-1
|
||||
@@ -539,6 +553,8 @@ done
|
||||
* rest noeat
|
||||
"a-zA-Z0-9_" global_var
|
||||
|
||||
.end
|
||||
|
||||
.subr comment_todo
|
||||
# initial state
|
||||
:comment_todo_init Comment
|
||||
|
Reference in New Issue
Block a user