Skip to content

Commit 00f8429

Browse files
committed
docs(parser): move isAdjacentStringConcat below isNamedExprListAhead, reattaching its javadoc
1 parent d43864f commit 00f8429

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,24 +1102,6 @@ public class CCJSqlParser extends AbstractJSqlParser<CCJSqlParser> {
11021102
* This replaces an expensive syntactic LOOKAHEAD(NamedExpressionListExprFirst())
11031103
* that caused exponential backtracking with deeply nested expressions.
11041104
*/
1105-
/**
1106-
* Semantic lookahead for the adjacent string literal concatenation in PrimaryExpression:
1107-
* true when Feature.adjacentStringLiterals is on and the next token is a string literal
1108-
* meeting the mode's separation rule (WHITESPACE: any, NEWLINE: a newline between the
1109-
* tokens, detected through the token line numbers).
1110-
*/
1111-
protected boolean isAdjacentStringConcat() {
1112-
String mode = getAsString(Feature.adjacentStringLiterals);
1113-
if (mode == null || AdjacentStringLiterals.OFF.name().equals(mode)) {
1114-
return false;
1115-
}
1116-
if (getToken(1).kind != S_CHAR_LITERAL) {
1117-
return false;
1118-
}
1119-
return AdjacentStringLiterals.WHITESPACE.name().equals(mode)
1120-
|| getToken(1).beginLine > getToken(0).endLine;
1121-
}
1122-
11231105
protected boolean isNamedExprListAhead() {
11241106
int depth = 0;
11251107
for (int i = 1; ; i++) {
@@ -1145,6 +1127,24 @@ public class CCJSqlParser extends AbstractJSqlParser<CCJSqlParser> {
11451127
}
11461128
}
11471129

1130+
/**
1131+
* Semantic lookahead for the adjacent string literal concatenation in PrimaryExpression:
1132+
* true when Feature.adjacentStringLiterals is on and the next token is a string literal
1133+
* meeting the mode's separation rule (WHITESPACE: any, NEWLINE: a newline between the
1134+
* tokens, detected through the token line numbers).
1135+
*/
1136+
protected boolean isAdjacentStringConcat() {
1137+
String mode = getAsString(Feature.adjacentStringLiterals);
1138+
if (mode == null || AdjacentStringLiterals.OFF.name().equals(mode)) {
1139+
return false;
1140+
}
1141+
if (getToken(1).kind != S_CHAR_LITERAL) {
1142+
return false;
1143+
}
1144+
return AdjacentStringLiterals.WHITESPACE.name().equals(mode)
1145+
|| getToken(1).beginLine > getToken(0).endLine;
1146+
}
1147+
11481148
/**
11491149
* Checks if the next token can start a condition suffix
11501150
* (comparison, IN, BETWEEN, LIKE, IS NULL, etc.)

0 commit comments

Comments
 (0)