PHP Object operator highlighting weird

Syntax highlighting, code folding, brace matching, code indenting, and function list

PHP Object operator highlighting weird

Postby jtrelfa » Thu Apr 12, 2007 12:38 pm

When using PHP objects, it's similar to the Perl object syntax:

[php]$object->method()
$object->property[/php]

Anyway, the -> operator, even though I've defined it in my word file, will only highlight the dash, but not both the dash AND the bracket when I do stuff like this:

[php]$object->method()
$object->_private
$object->property[/php]

but if I follow the bracket with something like quotes, forward slash, space, and some other characters:

[php]$object->"string"
$object->//comment
$object-> space_before_method()[/php]

Then the -> operator highlights properly.

Is there a way to ensure that the -> operator is highlighted regardless of what comes after it?

Thanks,

Jon
User avatar
jtrelfa
Newbie
 
Posts: 6
Joined: Wed Aug 16, 2006 11:00 pm

Re: PHP Object operator highlighting weird

Postby Mofi » Thu Apr 12, 2007 1:13 pm

That's a problem of the set of delimiter characters - see /Delimiters = in your word file for language PHP. The double quote, slash and space characters are all delimiters. The hypen is also a delimiter, but not > and not a-z_. So -> cannot be highlighted correct in this situation because the highligting engine "reads" for example the 3 "words": "$object" and "-" and ">_private".

Adding > to the delimiters will help here, but maybe will have some other bad effects elsewhere.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4042
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Syntax Highlighting