Community
Participate
Working Groups
Build Identifier: 20100917-0705 A new user (or someone going back to Epsilon after a while) might write the following code, expecting it to print "A" and then "B": "A".println(); operation f() {} "B".println(); However, the Epsilon book says in Section 3.1: "Each module defines a body and a number of operations. The body is a block of statements that are evaluated when the module is executed.". From this, it can be (vaguely) understood that all statements outside the operations should be before any operation. The reason for "B".println() not being run seems to be StatementBlockExecutor#execute. Particularly, its check "while (statementAst != null)": for the above code, statementAst is null when reaching the operator, and the loop completes without having reached "B".println(). I understand that this is the desired behaviour, as interleaving code between the operations would not work as expected anyway. Instead of running "A".println(), parsing the operation and then running "B".println(), what Epsilon does is 1) parse all operations, and then 2) run the global statement block. Still, in order to avoid surprising new users, I would suggest that: - statements interleaved between operations are explicitly marked as errors in the EOL editor. - make this more explicit in Section 3.1 of the Epsilon book. Regards. Antonio Reproducible: Always Steps to Reproduce: 1. Run the example EOL program.
Many thanks for reporting this!
Fixed in the SVN. Now the editor produces a warning if any statements appear after the first operation in an EOL/EGL file.
Fixed in the latest interim version. Fix will appear in 1.1.
Fixed in 1.1