Serpent Editor

+ comment cosmetic fix
This commit is contained in:
romanman 2014-06-17 18:59:43 +01:00
parent 56b7610368
commit 3ebeac67ef

View File

@ -217,9 +217,6 @@ public class SerpentTokenMaker extends AbstractTokenMaker {
currentTokenType = Token.ERROR_STRING_DOUBLE; currentTokenType = Token.ERROR_STRING_DOUBLE;
break; break;
case '%':
currentTokenType = Token.VARIABLE;
break;
// The "separators". // The "separators".
case '(': case '(':
@ -281,7 +278,8 @@ public class SerpentTokenMaker extends AbstractTokenMaker {
switch (c) { switch (c) {
case '/': case '/':
addToken(text, currentTokenStart,i-1, Token.COMMENT_EOL, newStartOffset+currentTokenStart); addToken(text, currentTokenStart,i-1,
Token.COMMENT_EOL, newStartOffset+currentTokenStart);
currentTokenStart = i; currentTokenStart = i;
currentTokenType = Token.COMMENT_EOL; currentTokenType = Token.COMMENT_EOL;
break; break;
@ -295,11 +293,6 @@ public class SerpentTokenMaker extends AbstractTokenMaker {
currentTokenType = Token.ERROR_STRING_DOUBLE; currentTokenType = Token.ERROR_STRING_DOUBLE;
break; break;
case '%':
addToken(text, currentTokenStart,i-1, Token.WHITESPACE, newStartOffset+currentTokenStart);
currentTokenStart = i;
currentTokenType = Token.VARIABLE;
break;
// The "separators". // The "separators".
case '(': case '(':
@ -387,11 +380,6 @@ public class SerpentTokenMaker extends AbstractTokenMaker {
currentTokenType = Token.ERROR_STRING_DOUBLE; currentTokenType = Token.ERROR_STRING_DOUBLE;
break; break;
case '%':
addToken(text, currentTokenStart,i-1, Token.IDENTIFIER, newStartOffset+currentTokenStart);
currentTokenStart = i;
currentTokenType = Token.VARIABLE;
break;
// Should be part of identifiers, but not at end of "REM". // Should be part of identifiers, but not at end of "REM".
case '\\': case '\\':
@ -447,10 +435,17 @@ public class SerpentTokenMaker extends AbstractTokenMaker {
case Token.COMMENT_EOL: case Token.COMMENT_EOL:
if (i+1 >= array.length)
break;
char nextC = array[i+1];
if (nextC == '/'){
i = end - 1; i = end - 1;
addToken(text, currentTokenStart,i, Token.COMMENT_EOL, newStartOffset+currentTokenStart); addToken(text, currentTokenStart,i, Token.COMMENT_EOL, newStartOffset+currentTokenStart);
// We need to set token type to null so at the bottom we don't add one more token. // We need to set token type to null so at the bottom we don't add one more token.
currentTokenType = Token.NULL; currentTokenType = Token.NULL;
}
break; break;
case Token.PREPROCESSOR: // Used for labels case Token.PREPROCESSOR: // Used for labels
@ -503,12 +498,6 @@ public class SerpentTokenMaker extends AbstractTokenMaker {
currentTokenType = Token.NULL; currentTokenType = Token.NULL;
} }
} }
else {
if (c=='%') {
addToken(text, currentTokenStart,i, Token.VARIABLE, newStartOffset+currentTokenStart);
currentTokenType = Token.NULL;
}
}
break; break;
} }
break; break;