JS+PHP syntax checking fails

Bug Reports and Fixes
Post Reply
Posts: 3
Joined: Tue May 20, 2008 12:46 pm

JS+PHP syntax checking fails

Post by puya » Tue May 20, 2008 12:58 pm


First of all, this being the first time I post on this forum, I'd like to congratulate the Spket team for the great work they've done.

Now the problems :)


I have Spket 1.6.12 installed as a plugin in Eclipse 3.3.2.
I set up *.tpl files to be edited with the Spket editor.
The *.tpl files are actually JS files with PHP code inserted for dynamic code generation.


The PHP code is grayed out which is perfect, but if the PHP code is inside a string ( between single/double quotes ) it is not escaped and of course Spket considers that there are syntax errors.

How to reproduce:

1. Create an empty .js file
2. Write something like :

Code: Select all

var a=<?='123'?>;
var b='<?=$var['key']?>';
3. The syntax checking will fail on the second line.


Site Admin
Posts: 678
Joined: Wed Sep 28, 2005 7:00 am

Post by eric_suen » Tue May 20, 2008 2:47 pm

Hi, for javascript code in php, please take a look at this thread: viewtopic.php?t=318

Because JavaScript and PHP both are dynamic language, It is not possible to avoid all syntax error...

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests