Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322394 - syntax highlighting fails for tag <<ENDREM->>
Summary: syntax highlighting fails for tag <<ENDREM->>
Status: CLOSED FIXED
Alias: None
Product: M2T
Classification: Modeling
Component: Xpand (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: M6   Edit
Assignee: Karsten Thoms CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 331930 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-08-11 11:34 EDT by Harald M CLA
Modified: 2017-10-31 10:59 EDT (History)
4 users (show)

See Also:
karsten.thoms: kepler+


Attachments
screenshot that shows the wrong highlighting (3.95 KB, image/png)
2010-08-11 11:36 EDT, Harald M CLA
no flags Details
fixes the syntaxHighlighting (3.65 KB, patch)
2011-03-15 07:00 EDT, Benedikt Niehues CLA
no flags Details | Diff
fixes the completionProposals (1.32 KB, patch)
2011-03-15 07:02 EDT, Benedikt Niehues CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Harald M CLA 2010-08-11 11:34:59 EDT
Build Identifier: Xpand SDK	1.0.0.v201006150611

The generation of whitespaces / linebreaks can be controlled by adding a minus sign just before any closing bracket.
The syntax highlighting marks the rest of the file as comment if this is applied to the tag <<ENDREM>>.



Reproducible: Always
Comment 1 Harald M CLA 2010-08-11 11:36:08 EDT
Created attachment 176367 [details]
screenshot that shows the wrong highlighting
Comment 2 Benedikt Niehues CLA 2011-03-15 07:00:31 EDT
Created attachment 191201 [details]
fixes the syntaxHighlighting

this patch fixes the syntaxHighlighting
The problem was, that two multiLineRules with the same startSeqence (REM) but with different endSequences were added to the XpandPartitionScanner. But on evaluating the rules the first rule which matches the startSequence will be evaluated and followers will not be evaluated.
So I introduced a MultiLineMultiEndSequenceRule for the XpandPartitionScanner which can evaluate rules with one startSequence and one or more endSequences like ENDREM and ENDREM-.
Comment 3 Benedikt Niehues CLA 2011-03-15 07:02:33 EDT
Created attachment 191202 [details]
fixes the completionProposals

this fixes the completionProposals in following partitions of comments ending with ENDREM-
Comment 4 Benedikt Niehues CLA 2011-03-15 07:06:26 EDT
There is still a problem with the parser! The "-" will not be recognized, so it is marked as a "mismatched input" error. In this case the grammar has to be expanded!
Comment 5 Karsten Thoms CLA 2013-02-18 08:04:03 EST
*** Bug 331930 has been marked as a duplicate of this bug. ***
Comment 6 Karsten Thoms CLA 2013-02-18 11:01:00 EST
The patch does not work properly, but it directed to the right location.

The MultiLineRule in XpandPartitionScanner needs to detect the situation that a '-' character is at the position where the closing bracket is expected. By overriding MultiLineRule#sequenceDetected this could be accomplished.

In the grammar the optional '-' character has to be added to the closing token:

COMMENT :
	'REM' RG ( options {greedy=false;} : . )* '\u00ABENDREM' '-'?
;
Comment 7 Karsten Thoms CLA 2013-02-19 03:32:18 EST
changeset 
  7551ba7b0f79ed8e4661f2d21e365488709905cc
  db5c8e077dfadfae2e0528fe5a98a1a27cbd62ec
Comment 8 Eclipse Webmaster CLA 2017-10-31 10:48:51 EDT
Requested via bug 522520.

-M.
Comment 9 Eclipse Webmaster CLA 2017-10-31 10:59:55 EDT
Requested via bug 522520.

-M.