PreviousNextTracker indexSee it online !

(21/212) 66 - 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:45 Assigned blueyed
Priority 5 Labels core
Status open Group v5.2
Resolution None

Comments

2006-10-07 18:17:54
blueyed

- **assigned_to**: nobody --> blueyed

2006-10-07 18:17:54
blueyed

Logged In: YES
user_id=663176

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:38
kantopet

Logged In: YES
user_id=1610934

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:23
mhall119

Logged In: YES
user_id=491022

> 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:

<SPAN TYPE="LITERAL1" DELEGATE="PHP_LITERAL1">
<BEGIN>"</BEGIN>
<END>"</END>
</SPAN>
<SPAN TYPE="LITERAL1">
<BEGIN>'</BEGIN>
<END>'</END>
</SPAN>
<SPAN TYPE="LITERAL1" DELEGATE="PHP_LITERAL1">
<BEGIN>\`</BEGIN>
<END>\`</END>
</SPAN>

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
appropriately.

2006-10-19 03:33:47
kantopet

Logged In: YES
user_id=1610934

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:13
pekarna

Logged In: YES
user_id=1053064
Originator: NO

See http://sourceforge.net/tracker/index.php?func=detail&aid=1800610&group_id=588&atid=350588