invalid syntax but no compilation errors

View: New views
2 Messages — Rating Filter:   Alert me  

invalid syntax but no compilation errors

by Varghese C V :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The following syntax throws no errors when compiled with janino even
though the syntax is invalid      

new SimpleCompiler().cook(new StringReader("public class Test{public
Test(){System.out.println(\"Test\"))if(1==1)return;}}"));

notice the
- double brackets System.out.println(\"Test\"))
- no semi-colon and begin of the if block

I have tested this with janino v2.5.10. Wonder what is causing this?

I have created a Jira entry for this
(http://jira.codehaus.org/browse/JANINO-108).

regards
Varghese


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: invalid syntax but no compilation errors

by Philipp Hagemeister :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hi Varghese,

can you reproduce the bug with the current janino (2.5.13)? On my
system, your test throws

Exception in thread "main" org.codehaus.janino.Parser$ParseException:
Line 1, Column 60: Operator ";" expected
        at org.codehaus.janino.Parser.throwParseException(Parser.java)
(...)

Kind Regards,

Philipp Hagemeister


Varghese Cottagiri wrote:
| The following syntax throws no errors when compiled with janino even
| though the syntax is invalid
| new SimpleCompiler().cook(new StringReader("public class Test{public
| Test(){System.out.println(\"Test\"))if(1==1)return;}}"));
|
| notice the
| - double brackets System.out.println(\"Test\"))
| - no semi-colon and begin of the if block
|
| I have tested this with janino v2.5.10. Wonder what is causing this?
|
| I have created a Jira entry for this
| (http://jira.codehaus.org/browse/JANINO-108).
|
| regards
| Varghese
|
|
| ---------------------------------------------------------------------
| To unsubscribe from this list, please visit:
|
|    http://xircles.codehaus.org/manage_email
|
|
|

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)

iD8DBQFH/zFl9eq1gvr7CFwRCnREAJ4txtBUgU0e9WOvmhZVHfIehVQnVACeNw+w
DeAhr4D0Zg5R5BVeyS2G9Hg=
=2fyB
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email