Closed codemanyak closed 7 months ago
Indeed, GOLDParser generates this kind of error, in "[...] the case where an unterminated comment block consumes the entire [remaining] program". Therefore, simply to append another empty line (which would in theory terminate the line comment) does not help while no substantial syntactical item follows up to the end of file. Of cource, the file preprocessor might automatically check for an endstanding line comment in the last non-blank line and cut if off, but it would then have to make sure that it does not wrongly detect duplicate slashes within string literals, delimited comments or something the like as line comment. So the question is whether it's worth the effort while the manual workaround is so easy.
At least we could provide an intelligible translation for the error code:
(In case of a really unterminated comment that is to be delimited like in the screenshot above, this error message still makes sense.)
Error reported as https://github.com/ridencww/goldengine/issues/28.
If a source file to be imported ends with a line comment then the parser fails with a "group_runaway" error, e.g. for Java:
If the comment follows in a separate line then the comment itself will not even be shown in the error window, which is even more puzzling.
As the GOLD Parser handles comments as "groups", this problem may be originating in that imported module.
The workaround is simple and straightforward; Remove the final comment before import. Alternatively, the line comment may be converted into a delimited comment:
/* end Coco */
in the end would not cause parser failure. Since a comment that does not precede any meaningful language item will not be imported, anyway, it does not matter for the imported diagrams, which of the workarounds is applied.