@@ -209,6 +209,7 @@ private interface Action extends Consumer<Parser> {}
209209 */
210210 private enum CharClass {
211211 IDENTIFIER_START , // Any character for which the method Character.isJavaIdentifierStart returns true
212+ // or '_'
212213 IDENTIFIER_PART , // Any character for which the method Character.isJavaIdentifierPart returns true
213214 LF , // Line feed / new line (\n), terminates line alone or in CR LF sequence
214215 CR , // Carriage return (\r), terminates line in CR LF sequence
@@ -234,8 +235,9 @@ private static CharClass charClass(char c) {
234235 case '-' : return DASH ;
235236 case '/' : return SLASH ;
236237 case ':' : return COLON ;
238+ case '_' : return IDENTIFIER_START ;
237239 default :
238- return Character .isJavaIdentifierStart (c ) || c == '_'
240+ return Character .isJavaIdentifierStart (c )
239241 ? IDENTIFIER_START
240242 : (Character .isJavaIdentifierPart (c ) ? IDENTIFIER_PART : OTHER );
241243 }
@@ -291,8 +293,10 @@ private enum State {
291293 },
292294 // Transitions from COLON state
293295 {
294- PARAMETER , // IDENTIFIER_START: first character of named parameter, switch to PARAMETER state
295- STATEMENT , // IDENTIFIER_PART: can't be first character of named parameter, go back to STATEMENT state
296+ PARAMETER , // IDENTIFIER_START: first character of named parameter,
297+ // switch to PARAMETER state
298+ STATEMENT , // IDENTIFIER_PART: can't be first character of named parameter,
299+ // go back to STATEMENT state
296300 STATEMENT , // LF: can't be first character of named parameter, go back to STATEMENT state
297301 STATEMENT , // CR: can't be first character of named parameter, go back to STATEMENT state
298302 STRING , // APOSTROPHE: not a named parameter but beginning of SQL string processing,
@@ -325,8 +329,10 @@ private enum State {
325329 },
326330 // Transitions from MULTILN_COMMENT_BG state
327331 {
328- STATEMENT , // IDENTIFIER_START: not starting sequence of multi line comment, go back to STATEMENT state
329- STATEMENT , // IDENTIFIER_PART: not starting sequence of multi line comment, go back to STATEMENT state
332+ STATEMENT , // IDENTIFIER_START: not starting sequence of multi line comment,
333+ // go back to STATEMENT state
334+ STATEMENT , // IDENTIFIER_PART: not starting sequence of multi line comment,
335+ // go back to STATEMENT state
330336 STATEMENT , // LF: not starting sequence of multi line comment, go back to STATEMENT state
331337 STATEMENT , // CR: not starting sequence of multi line comment, go back to STATEMENT state
332338 STRING , // APOSTROPHE: not starting sequence of multi line comment but beginning of SQL
@@ -343,8 +349,10 @@ private enum State {
343349 },
344350 // Transitions from MULTILN_COMMENT_END state
345351 {
346- MULTILN_COMMENT , // IDENTIFIER_START: not ending sequence of multi line comment, go back to MULTILN_COMMENT state
347- MULTILN_COMMENT , // IDENTIFIER_PART: not ending sequence of multi line comment, go back to MULTILN_COMMENT state
352+ MULTILN_COMMENT , // IDENTIFIER_START: not ending sequence of multi line comment,
353+ // go back to MULTILN_COMMENT state
354+ MULTILN_COMMENT , // IDENTIFIER_PART: not ending sequence of multi line comment,
355+ // go back to MULTILN_COMMENT state
348356 MULTILN_COMMENT , // LF: not ending sequence of multi line comment, go back to MULTILN_COMMENT state
349357 MULTILN_COMMENT , // CR: not ending sequence of multi line comment, go back to MULTILN_COMMENT state
350358 MULTILN_COMMENT , // APOSTROPHE: not ending sequence of multi line comment,
@@ -373,8 +381,10 @@ private enum State {
373381 },
374382 // Transitions from SINGLELN_COMMENT_BG state
375383 {
376- STATEMENT , // IDENTIFIER_START: not starting sequence of single line comment, go back to STATEMENT state
377- STATEMENT , // IDENTIFIER_PART: not starting sequence of single line comment, go back to STATEMENT state
384+ STATEMENT , // IDENTIFIER_START: not starting sequence of single line comment,
385+ // go back to STATEMENT state
386+ STATEMENT , // IDENTIFIER_PART: not starting sequence of single line comment,
387+ // go back to STATEMENT state
378388 STATEMENT , // LF: not starting sequence of single line comment, go back to STATEMENT state
379389 STATEMENT , // CR: not starting sequence of single line comment, go back to STATEMENT state
380390 STRING , // APOSTROPHE: not starting sequence of single line comment but beginning of SQL
@@ -390,8 +400,10 @@ private enum State {
390400 },
391401 // Transitions from SINGLELN_COMMENT_END state
392402 {
393- SINGLELN_COMMENT , // IDENTIFIER_START: not ending sequence of single line comment, go back to SINGLELN_COMMENT state
394- SINGLELN_COMMENT , // IDENTIFIER_PART: not ending sequence of single line comment, go back to SINGLELN_COMMENT state
403+ SINGLELN_COMMENT , // IDENTIFIER_START: not ending sequence of single line comment,
404+ // go back to SINGLELN_COMMENT state
405+ SINGLELN_COMMENT , // IDENTIFIER_PART: not ending sequence of single line comment,
406+ // go back to SINGLELN_COMMENT state
395407 STATEMENT , // LF: end of single line comment, switch to STATEMENT state
396408 SINGLELN_COMMENT_END , // CR: not ending sequence of single line comment but possible ending sequence
397409 // of next single line comment, retry end of single line comment processing
@@ -453,8 +465,8 @@ private enum State {
453465 // Actions performed on transitions from COLON state
454466 {
455467 Parser ::setFirstParamChar , // IDENTIFIER_START: set first parameter character
456- Parser ::addColonAndCopyChar , // IDENTIFIER_PART: not a parameter, add delayed colon and copy current statement character
457- // to output
468+ Parser ::addColonAndCopyChar , // IDENTIFIER_PART: not a parameter, add delayed colon and copy current
469+ // statement character to output
458470 Parser ::addColonAndCopyChar , // LF: not a parameter, add delayed colon and copy current statement character
459471 // to output
460472 Parser ::addColonAndCopyChar , // CR: not a parameter, add delayed colon and copy current statement character
0 commit comments