PreviousNextTracker indexSee it online !

(23/207) 1569363 - PHP Literals

PHP mode should be set up so that single and double quotes are assigned
to different literal types for the purposes of color coding (after all, there
are four possible literals available). Since single and double quotes serve
different functions in PHP, it would be a big help and it is an easy fix.

Submitted kantopet - 2006-10-02 - 15:31:45z Assigned blueyed
Priority 5 Category core
Status Open Group v4.3
Resolution None Visibility No


2006-10-07 - 18:17:54z
Logged In: YES

I'm using this locally already and will commit my modified
php.xml file once I get some things sorted out with jEdit's
syntax package.

Apart from the marking as LITERAL1 for both 'foo' and "bar",
it should highlight vars in "bar $foo" already, doesn't it?
2006-10-07 - 18:47:38z
Logged In: YES

So it does. At least in 4.2.

4.3 was giving me problems with some of my favorite toys so I rolled it back.

jEdit is my primary development tool, so I lack time to sort out problems that
interfere therewith, but just keeping up with current Web technology trends is
already overwhelming me, let alone sorthing through support applications.
Which I do feel guilty about at times, but I do promote it as editor of choice to
all my students.

The ideal solution would be allowing for user defined delimiters in the
configuration menus, but since I know zip nada about Java, all I can do is
throw that one out there. Don't know if it is appropriate to name another
third party editor as a source of some really good toys (like forced encoding
on load, and user definable literal delimiters), so I won't, but if people want
sources to loot and pillage ideas from, I can pass it on. It is Windows-only,
so it is useless to me.

So anyway, thanx.
2006-10-17 - 19:07:23z
Logged In: YES

> since I know zip nada about Java, all I
> can do is
> throw that one out there.

JEdit's mode files are XML, not Java, so go have a hand at
editing it, it's in <JEdit Install Dir>/modes/php.xml

The lines you're interested in are around line 273:


Just change the TYPE from "LITERAL1" to the highlighting
type you want ("LITERAL2", "LITERAL3", etc) to use for each
of the 3 string types (Double, Single, Backtick). Notice
that double quotes and backticks have
DELEGATE="PHP_LITERAL1", that tells JEdit to look for
inlined variables in those strings, and highlight them

2006-10-19 - 03:33:47z
Logged In: YES

No fair misrepresenting things by taking statements out of context. The" Java
zip nada" comment was associated with a suggestion that would significantly
alter some elements on and functions of the options menu. That is not in the
PHP mode file.

Although I suppose this is not the thread where I already posted my 4.2 PHP
mode file with said modifications, is it? Though if 4.3 is like 4.2, you will
actually have to change the information in three places in the PHP mode file
because you have to define the literals at every level in the literals branch of
the definition tree, which happens to be three nodes deep .

2007-09-23 - 14:21:13z
Logged In: YES
Originator: NO