syntax for php

Pavel Roskin proski at gnu.org
Wed Sep 19 22:37:39 UTC 2001


Hi, Max!

That's better :-)

> > What I wanted you to review is the contexts recognized by the original
> > php.syntax.  For example, it highlights most keywords only if they arrear
> > between <? and ?>, unlike your php.syntax, where they are highlighted in
> > the default context, i.e. even in the html text.
> Yes, i know it. It can be done only in 'context default' section (as Stephen
> made). But in this case another syntax cann't be complitely described.

I see.  There is no support for nesting contexts.

> > Your syntax file doesn't recognize such contexts as <! ... >
> > $ grep ^context php.syntax.v0
> ...
> > context <!-- --> green/4
> > context <! > green/4
> ...
>
> But this context did not allowed inside php program (inside <? ?>). PHP will
> show error (Parse error) if <! ... > context (and even any html tag) appear
> in program. In my syntax rules all text outside <? ?> have one color. And if
> it need to be highlighted, we must set colors as html text. This require
> extend syntax rules definition, and add ability to include another syntax
> rules depends of context.

I see.  PHP is designed to be included into HTML files, but the ability of
MC to handle them both in the same file is indeed limited.  So let's
hightlight PHP only.

> > I agree with you that the syntax highlighting engine is ugly.  But I don't
> > think that it's realistic to use Colorer for two reasons - it is
> > not under GPL and it is written in C++.
> Ok, if Colorer (or another library) will be under GPL, can you use it?

I would rather prefer to see another editor using Colorer library.
I think that modularity would be very appropriate here.

-- 
Regards,
Pavel Roskin





More information about the mc-devel mailing list