History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JANINO-64
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Arno Unkrig
Reporter: Mo DeJong
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Janino

continue statement not enclosed bug

Created: 13/Jul/06 06:46 PM   Updated: 20/Aug/06 04:10 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Java Source File Loop22.java (0.5 kb)
2. Text File scope_iterator.patch (3 kb)
3. Java Source File ScopeIterator.java (2 kb)

Environment: WinXP

Testcase included: yes


 Description  « Hide
I recently tried to update to Janino 2.4.5, but ran into a new regression. As a result, I have to keep using
a very old 2.3.18 release. I have included a small test case that shows the error:

$ janinoc Loop22.java
File Loop22.java, Line 12, Column 21: "continue" statement is not enclosed by a continuable statement
org.codehaus.janino.CompileException: 1 errors while compiling unit "Loop22.java
"



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Mo DeJong - 17/Jul/06 07:57 PM
Save as:

janino\src\org\codehaus\janino\util\iterator\ScopeIterator.java

and:

janino\src\org\codehaus\janino\scope_iterator.patch

Then apply scope_iterator.patch to UnitCompiler.java.

This fixes up the ugly scope iteration issues for the break
and continue statements in try blocks.


Arno Unkrig - 15/Aug/06 04:15 PM
Sorry for the late response.

The fix will go into 2.4.6.

The concept of your "ScopeIterator" is nice but not completely correct: It is not correct to iterate while "s instanceof Scope", but actually the conditions of when to terminate the iteration is very different depending on what you do (look up a type, a local variable, a breakable statement...). That's why I have not isolated that functionality in a "ScopeIterator" or alike.

However I am confident that now most of all bugs related to the introduction of the CatchClause (if not all) are now fixed.

CU

Arno


Arno Unkrig - 20/Aug/06 04:09 PM
Fixed with JANINO 2.4.6.