Improve Java 9 modules syntax highlighting
emmanue1
4 years ago
122 | 122 | switch (currentTokenType) { |
123 | 123 | case Token.NULL: |
124 | 124 | currentTokenStart = i; // Starting a new token here. |
125 | if (RSyntaxUtilities.isLetter(c) || c=='_') { | |
125 | if (RSyntaxUtilities.isLetter(c) || (c == '_')) { | |
126 | 126 | currentTokenType = Token.IDENTIFIER; |
127 | 127 | } else { |
128 | 128 | currentTokenType = Token.WHITESPACE; |
130 | 130 | break; |
131 | 131 | default: // Should never happen |
132 | 132 | case Token.WHITESPACE: |
133 | if (RSyntaxUtilities.isLetterOrDigit(c) || c=='_') { | |
133 | if (RSyntaxUtilities.isLetter(c) || (c == '_')) { | |
134 | 134 | addToken(text, currentTokenStart, i-1, Token.WHITESPACE, newStartOffset+currentTokenStart); |
135 | 135 | currentTokenStart = i; |
136 | 136 | currentTokenType = Token.IDENTIFIER; |
137 | 137 | } |
138 | 138 | break; |
139 | 139 | case Token.IDENTIFIER: |
140 | if (!RSyntaxUtilities.isLetterOrDigit(c) && c!='_') { | |
140 | if (!RSyntaxUtilities.isLetterOrDigit(c) && (c != '_') && (c != '.')) { | |
141 | 141 | addToken(text, currentTokenStart, i-1, Token.IDENTIFIER, newStartOffset+currentTokenStart); |
142 | 142 | currentTokenStart = i; |
143 | 143 | currentTokenType = Token.WHITESPACE; |