[Solar-talk] Solar and PHPEclipse

Rodrigo Moraes rodrigo.moraes at gmail.com
Sun Jul 16 16:59:25 PDT 2006


Hi.
While trying to discover why PHPEclipse reports so many errors in
Solar views, I found this old message to the list:

http://mail.killersoft.com/pipermail/solar-talk/2005-September/000358.html

Looking at PHPEclipse's Parser source [1], I discovered that it *can*
parse alternative syntax for control structures, but it will always
expect a semicolon after endif, endwhile, endfor and endforeach, even
when they are one-liners, but others one-line blocks will not require
a semicolon. So this does not generate an error:
<?php echo 'one-line block' ?>

... while this will result in: Parser error "';' expected after if-statement."
<?php endif ?>

Well, I've submitted a bug report to PHPEclipse providing a possible
solution to this problem [2]. However, I'm not used to Java and so I
haven't tried to compile it myself to see if the patch works. If
anyone with some Java knowledge want to try it, take a look at the bug
report and later share the .jar if it works. :)

On a side note, I think it doesn't hurt to always use a semi-colon in
the end of one-line php blocks. Even though this is not required by
the language in these circumstances, imo this seems to be a good
practice, but probably this is just a personal preference. ;)

regards,
rodrigo moraes / brazil

[1] http://fisheye1.cenqua.com/browse/~raw,r=1.98/phpeclipse/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Parser.java
[2] https://sourceforge.net/tracker/?func=detail&atid=484801&aid=1523506&group_id=57621


More information about the solar-talk mailing list