1
0
mirror of https://github.com/cmur2/joe-syntax.git synced 2024-12-22 12:54:23 +01:00

Improved js.jsf

Currently the regex has some serious problems - may fail in practice.
This commit is contained in:
Christian Nicolai 2011-08-06 00:39:04 +02:00
parent 8014f8603f
commit c09253442f

43
js.jsf
View File

@ -3,6 +3,13 @@
# the real one - not a pimped Java file... # the real one - not a pimped Java file...
# just getting this idea seams crazy... # just getting this idea seams crazy...
# TODO: regex escape highlighter ignored \x (and other?) sequences
# BUG: The regex has currently some SERIOUS problems - enabled
# or disabled: calc(a / b) vs match(/'/) - one of the two fails,
# need "after_term" support like in ruby.jsf
=Idle =Idle
=Comment green =Comment green
=CommentLabel bold green =CommentLabel bold green
@ -15,8 +22,9 @@
=Brace magenta =Brace magenta
=Control =Control
# additional classes not present everywhere but useful
=Methods =Methods
=Number fg_520 =Number cyan #fg_520 # orange
:idle Idle :idle Idle
* idle * idle
@ -39,6 +47,9 @@
:slash Idle :slash Idle
* idle noeat * idle noeat
# the "noeat recolor=-2" is needed since _this_ char maybe '\'
# * regex noeat recolor=-2
"*" comment recolor=-2 "*" comment recolor=-2
"/" line_comment recolor=-2 "/" line_comment recolor=-2
@ -59,7 +70,19 @@
"BFHNTX" line_comment noeat call=.comment_todo() "BFHNTX" line_comment noeat call=.comment_todo()
"\n" idle "\n" idle
:first_digit Constant #:regex Constant
# * regex
# "\\" regex_esc recolor=-1
# "/" regex_mod
#
#:regex_esc Escape
# * regex
#
#:regex_mod Constant
# * idle noeat
# "igm" regex_mod
:first_digit Number
* idle noeat * idle noeat
"xX" hex "xX" hex
"." float "." float
@ -71,35 +94,35 @@
* idle noeat * idle noeat
"0-9" bad_number "0-9" bad_number
:octal Constant :octal Number
* idle noeat * idle noeat
"0-7" octal "0-7" octal
"89" bad_number recolor=-1 "89" bad_number recolor=-1
:hex Constant :hex Number
* idle noeat * idle noeat
"0-9A-Fa-f" hex "0-9A-Fa-f" hex
:decimal Constant :decimal Number
* idle noeat * idle noeat
"0-9" decimal "0-9" decimal
"eE" epart "eE" epart
"." float "." float
:maybe_float Constant :maybe_float Number
* idle recolor=-2 noeat * idle recolor=-2 noeat
"0-9" float recolor=-2 "0-9" float recolor=-2
:float Constant :float Number
* idle noeat * idle noeat
"eE" epart "eE" epart
"0-9" float "0-9" float
:epart Constant :epart Number
* idle noeat * idle noeat
"0-9+\-" enum "0-9+\-" enum
:enum Constant :enum Number
* idle noeat * idle noeat
"0-9" enum "0-9" enum
@ -223,7 +246,7 @@ done
:ident_end Idle :ident_end Idle
* idle noeat * idle noeat
" " ident_end " " ident_end
"(" method_end recolormark "(" method_end noeat recolormark
:method_end Methods :method_end Methods
* idle noeat * idle noeat