#48 SEQ_REGEXP ignore look-behind/ahead assertion

open
nobody
None
5
2006-08-17
2006-08-17
Baldurien
No

Hi,

I don't know if that's a bug, but I would qualify it of
a feature request.

The php language propose the // and # comments.

But, the php lexer, will accept this :

// a comment
// a comment ?> some markup

Which woud lead to those tokens :

T_COMMENT
T_COMMENT
T_END_PHP
T_INLINE_HTML

The eol_span is rather good for than, but this will not
work with ?>.

This could be done with a regexp :

//.+\?>

And, because we don't want the ?>, this is needed :

//.+(?=\?>)

Currently jEdit will stop the comment mode after ?>, so
it's good. But it will continue in php mode, while I
wanted it to exit php mode and come back to html mode.

My feature is simple : support look behind and look
ahead regexp.

This could also be done using SEQ:

<SEQ DELEGATE="COMMENT_ONELINE_END"
TYPE="COMMENT1">//</SEQ>

<RULES SET="COMMENT_ONELINE_END">
<SEQ TYPE="MARKUP" DELEGATE="MAIN">?></SEQ>
<SEQ DELEGATE="PHP">\n</SEQ>
</RULES>

But I don't know if I can match the end of line (but I
guess I could use EOL_SPAN in conjuction with the SEQ)

Discussion