equal
deleted
inserted
replaced
94 val matcher = tokenPattern.matcher(text.content(matchStart, text.length)) |
94 val matcher = tokenPattern.matcher(text.content(matchStart, text.length)) |
95 var finished = false |
95 var finished = false |
96 var position = 0 |
96 var position = 0 |
97 while(matcher.find(position) && ! finished) { |
97 while(matcher.find(position) && ! finished) { |
98 position = matcher.end() |
98 position = matcher.end() |
99 val kind = if(isStartKeyword(matcher.group())){ |
99 val kind = if(isStartKeyword(matcher.group())) { |
100 Token.Kind.COMMAND_START |
100 Token.Kind.COMMAND_START |
101 } else if (matcher.end() - matcher.start() > 2 && matcher.group().substring(0, 2) == "(*"){ |
101 } else if (matcher.end() - matcher.start() > 2 && matcher.group().substring(0, 2) == "(*") { |
102 Token.Kind.COMMENT |
102 Token.Kind.COMMENT |
103 } else {""} |
103 } else { |
|
104 Token.Kind.OTHER |
|
105 } |
104 val newToken = new Token(matcher.start() + matchStart, matcher.end() + matchStart, kind) |
106 val newToken = new Token(matcher.start() + matchStart, matcher.end() + matchStart, kind) |
105 |
107 |
106 if (firstAdded == null) |
108 if (firstAdded == null) |
107 firstAdded = newToken |
109 firstAdded = newToken |
108 else { |
110 else { |