eclipse / epsilon

Epsilon is a family of Java-based scripting languages for automating common model-based software engineering tasks, such as code generation, model-to-model transformation and model validation, that work out of the box with EMF (including Xtext and Sirius), UML (including Cameo/MagicDraw), Simulink, XML and other types of models.
https://eclipse.org/epsilon
Eclipse Public License 2.0
66 stars 10 forks source link

EGX: Show EGL parse problem details #38

Closed Arkaedan closed 1 year ago

Arkaedan commented 1 year ago

Currently, when there is a parse error in an EGL file being executed from EGX, there is no info shown about where the error is. Here is the current error message that is shown:

Parse error(s) in file:/C:/Users/username/AppData/Local/Temp/epsilon/rule.egl
    at (C:\Users\username\AppData\Local\Temp\epsilon\transformation.egx@7:0-14:1)
    at (C:\Users\username\AppData\Local\Temp\epsilon\transformation.egx@7:0-14:1)
    at (C:\Users\username\AppData\Local\Temp\epsilon\transformation.egx@1:0-18:1)

This PR adds the parse error details to the error message:

Parse error(s) in file:/C:/Users/username/AppData/Local/Temp/epsilon/rule.egl: Line: 2, Column: 17, Reason: no viable alternative at input '('
    at (C:\Users\username\AppData\Local\Temp\epsilon\transformation.egx@7:0-14:1)
    at (C:\Users\username\AppData\Local\Temp\epsilon\transformation.egx@7:0-14:1)
    at (C:\Users\username\AppData\Local\Temp\epsilon\transformation.egx@1:0-18:1)

It would be nice to be able to format the line and column details in the (<path>@<line>:<column>-<line>:<column>) format so that IDEs can hyperlink to the exact location. However, I could not find an easy way to do that.

agarciadom commented 1 year ago

This looks good - thank you for your contribution!