Skip to content

Commit

Permalink
Improve Java 9 modules syntax highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanue1 committed Jun 2, 2019
1 parent 40e0960 commit 9fbddd5
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,22 +123,22 @@ public Token getTokenList(Segment text, int startTokenType, int startOffset) {
switch (currentTokenType) {
case Token.NULL:
currentTokenStart = i; // Starting a new token here.
if (RSyntaxUtilities.isLetter(c) || c=='_') {
if (RSyntaxUtilities.isLetter(c) || (c == '_')) {
currentTokenType = Token.IDENTIFIER;
} else {
currentTokenType = Token.WHITESPACE;
}
break;
default: // Should never happen
case Token.WHITESPACE:
if (RSyntaxUtilities.isLetterOrDigit(c) || c=='_') {
if (RSyntaxUtilities.isLetter(c) || (c == '_')) {
addToken(text, currentTokenStart, i-1, Token.WHITESPACE, newStartOffset+currentTokenStart);
currentTokenStart = i;
currentTokenType = Token.IDENTIFIER;
}
break;
case Token.IDENTIFIER:
if (!RSyntaxUtilities.isLetterOrDigit(c) && c!='_') {
if (!RSyntaxUtilities.isLetterOrDigit(c) && (c != '_') && (c != '.')) {
addToken(text, currentTokenStart, i-1, Token.IDENTIFIER, newStartOffset+currentTokenStart);
currentTokenStart = i;
currentTokenType = Token.WHITESPACE;
Expand Down

0 comments on commit 9fbddd5

Please sign in to comment.