mirror of
https://github.com/cmur2/joe-syntax.git
synced 2024-12-22 12:54:23 +01:00
Extended ruby.jsf
New features are: - TODO (and FIXME, BUG, XXX) highlight in oneline comments (bold green) - :symbols support (red) - proc block argument highlight for e.g. |arg,val| (yellow, disabled) - class member highlight for e.g. @field (brown, disabled) - additional quasi-keywords Disabled features may be enabled by setting a color in the header.
This commit is contained in:
parent
e6384eab3f
commit
56f2134055
74
ruby.jsf
74
ruby.jsf
@ -16,6 +16,11 @@
|
|||||||
=Bad bold red
|
=Bad bold red
|
||||||
=Var yellow
|
=Var yellow
|
||||||
|
|
||||||
|
=CommentTODO bold green
|
||||||
|
=Symbol red
|
||||||
|
=ProcArg #yellow
|
||||||
|
=ClassMember #fg_310 # brown
|
||||||
|
|
||||||
# Detect pod
|
# Detect pod
|
||||||
|
|
||||||
:idle Idle
|
:idle Idle
|
||||||
@ -40,6 +45,11 @@
|
|||||||
"%" pstring
|
"%" pstring
|
||||||
"a-zA-Z_" ident buffer
|
"a-zA-Z_" ident buffer
|
||||||
|
|
||||||
|
# added
|
||||||
|
":" maybe_symbol noeat
|
||||||
|
"|" proc_arg
|
||||||
|
"@" class_member recolor=-1
|
||||||
|
|
||||||
# / / regex not allowed after terms
|
# / / regex not allowed after terms
|
||||||
|
|
||||||
:after_term Idle
|
:after_term Idle
|
||||||
@ -149,10 +159,33 @@ done
|
|||||||
* line_comment
|
* line_comment
|
||||||
"\n" rest
|
"\n" rest
|
||||||
|
|
||||||
|
# pimped by a line matching on possible upper-case "todo" labels (like TODO, FIXME, etc.)
|
||||||
|
# and buffering all following chars in :line_comment_todo_guess
|
||||||
:line_comment_i Comment
|
:line_comment_i Comment
|
||||||
* line_comment_i
|
* line_comment_i
|
||||||
|
"TFBX" line_comment_todo_guess noeat buffer
|
||||||
"\n" idle
|
"\n" idle
|
||||||
|
|
||||||
|
# if the current char _is_ in [A-Z] put it to the buffer
|
||||||
|
# if it's not (e.g. a space) then it is an unknown char so we should exit
|
||||||
|
# but before we'll check if the buffer matches one of our keywords (like TODO)
|
||||||
|
# and color it so - else we are wrong with the guess that it's a todo-keyword
|
||||||
|
# so it's a normal 'Comment'
|
||||||
|
:line_comment_todo_guess Comment
|
||||||
|
* line_comment_todo_unknown noeat strings
|
||||||
|
"TODO" line_comment_todo
|
||||||
|
"FIXME" line_comment_todo
|
||||||
|
"BUG" line_comment_todo
|
||||||
|
"XXX" line_comment_todo
|
||||||
|
done
|
||||||
|
"A-Z" line_comment_todo_guess
|
||||||
|
|
||||||
|
:line_comment_todo_unknown Idle
|
||||||
|
* line_comment_i noeat
|
||||||
|
|
||||||
|
:line_comment_todo CommentTODO
|
||||||
|
* line_comment_i noeat
|
||||||
|
|
||||||
:end_of_file_comment Comment
|
:end_of_file_comment Comment
|
||||||
* end_of_file_comment
|
* end_of_file_comment
|
||||||
|
|
||||||
@ -358,6 +391,14 @@ done
|
|||||||
"when" kw
|
"when" kw
|
||||||
"while" kw
|
"while" kw
|
||||||
"yield" kw
|
"yield" kw
|
||||||
|
# quasi-keywords (Module or Kernel methods)
|
||||||
|
"require" kw
|
||||||
|
"include" kw
|
||||||
|
"puts" kw
|
||||||
|
"exit" kw
|
||||||
|
"attr_accessor" kw
|
||||||
|
"attr_reader" kw
|
||||||
|
"attr_writer" kw
|
||||||
done
|
done
|
||||||
"a-zA-Z0-9_" ident
|
"a-zA-Z0-9_" ident
|
||||||
|
|
||||||
@ -421,3 +462,36 @@ done
|
|||||||
|
|
||||||
:repl_quote Escape
|
:repl_quote Escape
|
||||||
* repl
|
* repl
|
||||||
|
|
||||||
|
:maybe_symbol Idle
|
||||||
|
* rest noeat
|
||||||
|
":" maybe_symbol2
|
||||||
|
|
||||||
|
:maybe_symbol2 Idle
|
||||||
|
* rest noeat
|
||||||
|
# prevent wrong Module::Member detection
|
||||||
|
":" rest
|
||||||
|
# first char mustn't be 0-9
|
||||||
|
"a-zA-Z_" symbol
|
||||||
|
# # might be a :"symbol"
|
||||||
|
# "\""
|
||||||
|
|
||||||
|
:symbol Symbol
|
||||||
|
* rest noeat
|
||||||
|
"a-zA-Z0-9_" symbol recolor=-3
|
||||||
|
|
||||||
|
:proc_arg ProcArg
|
||||||
|
* rest noeat
|
||||||
|
"," proc_arg_sep noeat
|
||||||
|
"a-zA-Z_" proc_arg
|
||||||
|
|
||||||
|
:proc_arg_sep Idle
|
||||||
|
* proc_arg
|
||||||
|
|
||||||
|
:class_member1 ClassMember
|
||||||
|
* rest noeat
|
||||||
|
"a-zA-Z_" class_member
|
||||||
|
|
||||||
|
:class_member ClassMember
|
||||||
|
* rest noeat
|
||||||
|
"a-zA-Z0-9_" class_member
|
||||||
|
Loading…
Reference in New Issue
Block a user