@@ -120,7 +120,7 @@ public List<Token> tokenize() {
120120 while (pos < length ) {
121121 final char current = peek (0 );
122122 if (Character .isDigit (current )) tokenizeNumber ();
123- else if (Character . isJavaIdentifierStart (current )) tokenizeWord ();
123+ else if (isOwnLangIdentifierStart (current )) tokenizeWord ();
124124 else if (current == '`' ) tokenizeExtendedWord ();
125125 else if (current == '"' ) tokenizeText ();
126126 else if (current == '#' ) {
@@ -208,9 +208,10 @@ private void tokenizeOperator() {
208208
209209 private void tokenizeWord () {
210210 clearBuffer ();
211- char current = peek (0 );
211+ buffer .append (peek (0 ));
212+ char current = next ();
212213 while (true ) {
213- if (!Character . isLetterOrDigit (current ) && ( current != '_' ) && ( current != '$' )) {
214+ if (!isOwnLangIdentifierPart (current )) {
214215 break ;
215216 }
216217 buffer .append (current );
@@ -224,7 +225,7 @@ private void tokenizeWord() {
224225 addToken (TokenType .WORD , word );
225226 }
226227 }
227-
228+
228229 private void tokenizeExtendedWord () {
229230 next ();// skip `
230231 clearBuffer ();
@@ -306,6 +307,14 @@ private void tokenizeMultilineComment() {
306307 next (); // *
307308 next (); // /
308309 }
310+
311+ private boolean isOwnLangIdentifierStart (char current ) {
312+ return (Character .isLetter (current ) || (current == '_' ) || (current == '$' ));
313+ }
314+
315+ private boolean isOwnLangIdentifierPart (char current ) {
316+ return (Character .isLetterOrDigit (current ) || (current == '_' ) || (current == '$' ));
317+ }
309318
310319 private void clearBuffer () {
311320 buffer .setLength (0 );
0 commit comments