Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Duplicate
-
Affects Version/s: 2.5.2.Release
-
Fix Version/s: 2.6.0.Release
-
Component/s: Editor
-
Labels:None
-
Environment:Linux / Eclipse Version: 3.6.1
-
Number of attachments :
Description
We want to composite slashed strings from substrings:
import java.util.regex.Pattern; public class Syntax { private final static String OPTIONALLY_SIGNED_INT = /((\+|\-)?(\d+))/ private final static String OPTIONALLY_NEG_INT = /((\-)?(\d+))/ private final static String SIGNED_INT = /((\+|\-)(\d+))/ private final static Pattern PAT_T1 = ~(/^/ + OPTIONALLY_SIGNED_INT + /((X|x)*)$/) private final static Pattern PAT_T2 = ~(/^/ + OPTIONALLY_SIGNED_INT + /\s*(<|<=|=<|>|>=|=>|\-|\.\.|\.\.\.|≤|≥)$/) private final static Pattern PAT_T3 = ~(/^(<|<=|=<|>|>=|=>|\.\.|\.\.\.|≤|≥)\s*/ + OPTIONALLY_SIGNED_INT + /$/) private final static Pattern PAT_T3X = ~(/^(\-)\s*/ + SIGNED_INT + /$/) // special case of T3integer private final static Pattern PAT_T3XX = ~(/^(\-)\s+/ + OPTIONALLY_NEG_INT + /$/) // special case of T3 private final static Pattern PAT_T4 = ~(/^/ + OPTIONALLY_SIGNED_INT + /\s*(,|\.\.|\.\.\.)\s*/ + OPTIONALLY_SIGNED_INT + /$/) private final static Pattern PAT_T4X = ~(/^/ + OPTIONALLY_SIGNED_INT + /\s*(\-)\s*/ + SIGNED_INT + /$/) // special case of T4 private final static Pattern PAT_T4XX = ~(/^/ + OPTIONALLY_SIGNED_INT + /\s*(\-)\s+/ + OPTIONALLY_NEG_INT + /$/) // special case of T4 }
The /$/ confuses the syntax highlighter. It seems to think this has something to do with a variable maybe?
See attachment for the highlighting. There are no compiler errors and the associated program passes testcases.
Issue Links
- duplicates
-
GRECLIPSE-1203
Syntax highlight for slashed strings
-
Unfortunately, this is a tough problem. Slashy string detection is performed using regular expressions on the text (for performance reasons). But, there are times when there are open and close slashy string delimiters in the text for other reasons.
One possibility is to completely remove slashy string highlighting.