From 990e9d8b10a92ec91ddff921b84eff9e4121fe8f Mon Sep 17 00:00:00 2001 From: james Date: Thu, 19 Dec 2024 07:53:31 +1100 Subject: [PATCH] #57: Further work to support Intellij plugin --- src/main/java/io/jactl/Tokeniser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/jactl/Tokeniser.java b/src/main/java/io/jactl/Tokeniser.java index 986c480..89cefe4 100644 --- a/src/main/java/io/jactl/Tokeniser.java +++ b/src/main/java/io/jactl/Tokeniser.java @@ -628,7 +628,7 @@ private Token parseIdentifier(Token token, int remaining) { // Search for first char that is not a valid identifier char int i = 1; int digitCount = 0; - boolean isDigits = startChar == '$' && isDigit(charAt(1), 10); + boolean isDigits = startChar == '$' && remaining > 1 && isDigit(charAt(1), 10); for (; i < remaining && (isDigits ? isDigit(charAt(i), 10) : isIdentifierPart(charAt(i))); i++) { digitCount += isDigit(charAt(i), 10) ? 1 : 0; }