I'm currently creating a language with a friend and I would like to provide a highlighting for it in jEdit.
It's syntax is actually quite simple. The functions can only match this pattern:
$function_name(arguments)
Note that our parser is currently working without closing tag like the C-style semi-column and that we would like to keep this feature.
I created my jEdit mode and (almost) succeeded in highligting my pattern with <SPAN_REGEXP>
. Here's how I did it:
<SPAN_REGEXP HASH_CAR="\$" TYPE="KEYWORD3" DELEGATE="ARGS">
<BEGIN>\$[A-Za_z0-9_]*\s*\(</BEGIN>
<END>)</END>
</SPAN_REGEXP>
But It's not good enough.
Here's what I would like:
- Same color for the entire function skeleton :
$func( )
- Special highlighting (already defined within the
ARGS
rules set) for%content1%
in$func(%content1%)
- No highlighting for brackets not following a
$func
- Authorize alternative multiline syntax like
$func
(
args
)
which is for now not highlighted.
I guessed I needed to change my <BEGIN>
regexp to accept newlines, but it seems that jEdit is unable to match multiline regexp for highlighting although he does it perfectly for search&replace !
I tried the (?s)
and (?m)
flags, the [\d\D]*
workaround, even [\r\n]*
but it never works.
So, here are my questions:
- Does anyone know how to match multiline regexp in jEdit modes
<SPAN_REGEXP>
? - If not, does anyone have any idea how to do what I need ?