Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346016 - EOL Editor Supported Comments
Summary: EOL Editor Supported Comments
Status: CLOSED FIXED
Alias: None
Product: Epsilon
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Antonio Garcia-Dominguez CLA
QA Contact:
URL:
Whiteboard: interim
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-16 20:04 EDT by Horacio Hoyos CLA
Modified: 2012-02-06 10:59 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Horacio Hoyos CLA 2011-05-16 20:04:01 EDT
When editing epsilon languages the editor fails to correctly recognize the end of multiline comments when using the /* ... */ or the -* ... *- style. This happens either with new comments or when editing existing ones. If the file is closed and reopened the editor recognizes the comment ends correctly. 

The bug is detected because after the comment is closed the rest of the text in the file remains colored as comments.
Comment 1 Antonio Garcia-Dominguez CLA 2011-05-17 04:52:31 EDT
Thanks for your report! I'll have a look today at the bug.
Comment 2 Antonio Garcia-Dominguez CLA 2011-05-17 07:39:10 EDT
This is a follow up to this thread in the forum:

http://www.eclipse.org/forums/index.php/t/209207/

I think I have fixed the problem in SVN r1422. The fix itself is trivial, but finding the part that required fixing took a while.

The partition scanner we use to divide the program into comment and non-comment sections has two JFace MultiLineRules for the -* *- and /* */ comments. Normally, these rules look for their start delimiter and then for their end delimiter. In this case, the rules do not conflict, as they start with different characters.

However, there's one case in which PatternRule#doEvaluate skips looking for the start sequence: when "resuming" the partition scanning. This happens when we insert a newline inside a comment, for example. PatternRule sees the * in *- and mistakes it for the * in */. Since breakOnEOF is set to true for that rule, it plows through the rest of the file and accepts EOF as an end sequence.

I have fixed this bug by setting breakOnEOF to false, so it will properly reject the */ rule and go to the *- rule.
Comment 3 Dimitris Kolovos CLA 2011-07-25 08:18:04 EDT
Fixed in 0.9.1