mirror of
https://github.com/cmur2/joe-syntax.git
synced 2024-11-08 22:56:14 +01:00
New syntax highlighting for Ant scripts
Common file for ftyperc: build.xml This jsf is derived from the XML highlighter but with changed colors matching the fact that for Ant <tags> are important (and blue is bad here). Features: - Ant variable reference highlighting for e.g. ${build.dir}
This commit is contained in:
parent
fe150361d1
commit
1a314919ff
293
ant.jsf
Normal file
293
ant.jsf
Normal file
@ -0,0 +1,293 @@
|
||||
# JOE syntax highlight file for Ant's build scripts
|
||||
|
||||
# http://ant.apache.org/
|
||||
|
||||
# using the XML highlighter with better colors since
|
||||
# ant scripts heavily rely on the tags (blue is a bad color here)
|
||||
# instead of their contents
|
||||
|
||||
# Improved XML highlighter by: Brian Candler <B.Candler@pobox.com>
|
||||
|
||||
=Idle
|
||||
=Bad red bold
|
||||
=Tag bold
|
||||
=Attr
|
||||
=Constant cyan
|
||||
=Escape bold cyan
|
||||
=EntityRef magenta
|
||||
=Decl cyan
|
||||
=CommentStart green
|
||||
=CommentBody green
|
||||
=CommentEnd green
|
||||
=PIStart magenta bold
|
||||
=PIBody magenta
|
||||
=PIEnd magenta bold
|
||||
=CdataStart blue bold
|
||||
=CdataBody bold
|
||||
=CdataEnd blue bold
|
||||
|
||||
# http://www.w3.org/TR/2004/REC-xml-20040204/
|
||||
#
|
||||
# NOTE: For UNICODE compatibility, the ranges
|
||||
# "A-Za-z_:" -- first character of Name
|
||||
# "A-Za-z0-9._:-" -- subsequent characters of Name
|
||||
# ought to be replaced with some appropriate Unicode character classes
|
||||
|
||||
:content Idle
|
||||
* content
|
||||
"<" tag recolor=-1
|
||||
"&" entityref recolor=-1
|
||||
|
||||
# > is allowed
|
||||
# ">" error noeat recolor=-1
|
||||
|
||||
|
||||
# In several contexts a space is an error, and since a coloured space is
|
||||
# not visible, we colour the next non-space character as well.
|
||||
|
||||
:error Bad
|
||||
* error_visible noeat recolor=-1
|
||||
" \t\r\n" error
|
||||
|
||||
:error_visible Bad
|
||||
* content
|
||||
|
||||
# Matched: &
|
||||
|
||||
:entityref EntityRef
|
||||
* error noeat recolor=-1
|
||||
"A-Za-z0-9._:-" entityref
|
||||
"#" entityref
|
||||
";" content
|
||||
|
||||
# Matched: <
|
||||
|
||||
:tag Tag
|
||||
* error noeat recolor=-1
|
||||
"/" end_tag
|
||||
"A-Za-z_:" start_or_empty_tag
|
||||
"?" pi_start recolor=-2
|
||||
"!" decl recolor=-2 buffer
|
||||
|
||||
# Matched: </
|
||||
|
||||
:end_tag Tag
|
||||
* error noeat recolor=-1
|
||||
"A-Za-z_:" end_tag2
|
||||
|
||||
:end_tag2 Tag
|
||||
* error noeat recolor=-1
|
||||
"A-Za-z0-9._:-" end_tag2
|
||||
" \t\r\n" end_tag2_sp recolor=-1
|
||||
">" content
|
||||
|
||||
:end_tag2_sp Idle
|
||||
* end_tag3 noeat
|
||||
|
||||
:end_tag3 Tag
|
||||
* error noeat recolor=-1
|
||||
" \t\r\n" end_tag3_sp recolor=-1
|
||||
">" content
|
||||
|
||||
:end_tag3_sp Idle
|
||||
* end_tag_3 noeat
|
||||
|
||||
# Matched: <tag
|
||||
|
||||
:start_or_empty_tag Tag
|
||||
* error noeat recolor=-1
|
||||
"A-Za-z0-9._:-" start_or_empty_tag
|
||||
"/" empty_tag
|
||||
" \t\r\n" start_or_empty_tag_sp recolor=-1
|
||||
">" content
|
||||
|
||||
:start_or_empty_tag_sp Idle
|
||||
* tag_space noeat
|
||||
|
||||
# Matched: <tag/
|
||||
|
||||
:empty_tag Tag
|
||||
* error noeat recolor=-1
|
||||
">" content
|
||||
|
||||
# Matched: <tag SPACE
|
||||
|
||||
:tag_space Attr
|
||||
* error noeat recolor=-1
|
||||
" \t\r\n" tag_space_sp recolor=-1
|
||||
"A-Za-z_:" attr
|
||||
"/" empty_tag recolor=-1
|
||||
">" close_tag recolor=-1
|
||||
|
||||
:tag_space_sp Idle
|
||||
* tag_space noeat
|
||||
|
||||
# Matched: <tag attr
|
||||
|
||||
:attr Attr
|
||||
* error noeat recolor=-1
|
||||
"A-Za-z0-9._:-" attr
|
||||
" \t\r\n" attr_sp recolor=-1
|
||||
"=" string
|
||||
|
||||
:attr_sp Idle
|
||||
* attr_before noeat
|
||||
|
||||
:attr_before Attr
|
||||
* error noeat recolor=-1
|
||||
" \t\r\n" attr_sp recolor=-1
|
||||
"=" string
|
||||
|
||||
# Matched: <tag attr=
|
||||
|
||||
:string Attr
|
||||
* error noeat recolor=-1
|
||||
" \t\r\n" string_sp recolor=-1
|
||||
"\"" string_dq recolor=-1
|
||||
"'" string_sq recolor=-1
|
||||
|
||||
:string_sp Idle
|
||||
* string noeat
|
||||
|
||||
# Matched: <tag attr="
|
||||
|
||||
:string_dq Constant
|
||||
* string_dq
|
||||
"<" error noeat recolor=-1
|
||||
"&" char_dq recolor=-1
|
||||
"\"" endstring
|
||||
"$" maybe_antvar_dq
|
||||
|
||||
# ">" error noeat recolor=-1
|
||||
|
||||
|
||||
:string_sq Constant
|
||||
* string_sq
|
||||
"<" error noeat recolor=-1
|
||||
"&" char_sq recolor=-1
|
||||
"'" endstring
|
||||
"$" maybe_antvar_sq
|
||||
|
||||
# ">" error noeat recolor=-1
|
||||
|
||||
|
||||
:char_dq EntityRef
|
||||
* error noeat recolor=-1
|
||||
"A-Za-z0-9._:-" char_dq
|
||||
"#" char_dq
|
||||
";" string_dq
|
||||
|
||||
:char_sq EntityRef
|
||||
* error noeat recolor=-1
|
||||
"A-Za-z0-9._:-" char_sq
|
||||
"#" char_sq
|
||||
";" string_sq
|
||||
|
||||
:maybe_antvar_dq Constant
|
||||
* string_dq
|
||||
"{" antvar_dq recolor=-2
|
||||
|
||||
:antvar_dq Escape
|
||||
* antvar_dq
|
||||
"}" string_dq
|
||||
|
||||
:maybe_antvar_sq Constant
|
||||
* string_sq
|
||||
"{" antvar_sq recolor=-2
|
||||
|
||||
:antvar_sq Escape
|
||||
* antvar_sq
|
||||
"}" string_sq
|
||||
|
||||
# Matched: <tag attr="foo"
|
||||
|
||||
:endstring Attr
|
||||
* error noeat recolor=-1
|
||||
" \t\r\n" tag_space_sp
|
||||
"/" empty_tag recolor=-1
|
||||
">" close_tag recolor=-1
|
||||
|
||||
# This state is just to recolor the final ">" at the end of <tag attr="val">
|
||||
|
||||
:close_tag Tag
|
||||
* content noeat
|
||||
|
||||
# Matched: <?
|
||||
|
||||
:pi_start PIStart
|
||||
* pi noeat recolor=-1
|
||||
|
||||
:pi PIBody
|
||||
* pi
|
||||
"?" pi2
|
||||
|
||||
:pi2 PIBody
|
||||
* pi
|
||||
">" pi_end recolor=-2
|
||||
|
||||
:pi_end PIEnd
|
||||
* content noeat recolor=-1
|
||||
|
||||
# Matched: <!
|
||||
|
||||
:decl Decl
|
||||
* decl strings
|
||||
"!--" comment_start recolor=-5
|
||||
"![CDATA[" cdata_start recolor=-10
|
||||
done
|
||||
"<" decl_nest
|
||||
">" content
|
||||
|
||||
# We allow one level of <...> nesting within declarations
|
||||
|
||||
:decl_nest Decl
|
||||
* decl_nest
|
||||
">" decl
|
||||
|
||||
# Matched: <!--
|
||||
|
||||
:comment_start CommentStart
|
||||
* comment noeat
|
||||
|
||||
:comment CommentBody
|
||||
* comment
|
||||
"-" comment2
|
||||
|
||||
:comment2 CommentBody
|
||||
* comment
|
||||
"-" comment3
|
||||
|
||||
:comment3 CommentBody
|
||||
* comment_error noeat recolor=-3
|
||||
">" comment_end recolor=-3
|
||||
|
||||
:comment_end CommentEnd
|
||||
* content noeat recolor=-1
|
||||
|
||||
# For compatibility, the string "--" (double-hyphen) MUST NOT occur within
|
||||
# comments. [http://www.w3.org/TR/REC-xml/ section 2.5]
|
||||
|
||||
:comment_error Bad
|
||||
* comment
|
||||
"-" comment_error
|
||||
">" comment_end recolor=-3
|
||||
|
||||
# Matched: <![CDATA[
|
||||
|
||||
:cdata_start CdataStart
|
||||
* cdata noeat
|
||||
|
||||
:cdata CdataBody
|
||||
* cdata
|
||||
"]" cdata2
|
||||
|
||||
:cdata2 CdataBody
|
||||
* cdata
|
||||
"]" cdata3
|
||||
|
||||
:cdata3 CdataBody
|
||||
* cdata
|
||||
">" cdata_end recolor=-3
|
||||
|
||||
:cdata_end CdataEnd
|
||||
* content noeat recolor=-1
|
Loading…
Reference in New Issue
Block a user