You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 84d23e7
Browse filesBrowse the repository at this point in the historyBrowse files
* feat(parser): concatenate adjacent string literals behind adjacentStringLiterals
Three readings of two neighboring string literals: alias (MySQL, SQL
Server, the current behavior), concatenated across a newline (the SQL
standard and PostgreSQL), concatenated across any whitespace (GoogleSQL,
Spark/Databricks). The mode lives in a String valued Feature like
Feature.dialect, the merge is one guarded loop in PrimaryExpression
using the token line numbers for the newline rule, producing a single
merged StringValue. ANSI_SQL and POSTGRESQL presets carry NEWLINE.
Implements item 3 of #2512.
* docs(site): document adjacentStringLiterals in the parser features section
* hardening: null-safe mode check in isAdjacentStringConcat
The FeatureConfiguration seeds every configurable Feature with its
declared default, so the mode is never null today; the guard keeps the
predicate locally correct regardless.
* feat(parser): withAdjacentStringLiterals(boolean) mapping false = OFF, true = NEWLINE
stores the AdjacentStringLiterals enum constant itself as the feature value
* docs(parser): move isAdjacentStringConcat below isNamedExprListAhead, reattaching its javadoc
Copy file name to clipboardExpand all lines: src/site/sphinx/usage.rst
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -279,7 +279,7 @@ Define the Parser Features
279
279
280
280
JSQLParser interprets Squared Brackets ``[..]`` as Arrays, which does not work with MS SQL Server and T-SQL. Please use the Parser Features to instruct JSQLParser to read Squared Brackets as Quotes instead.
281
281
282
-
JSQLParser allows for standard compliant Single Quote ``'..`` Escaping. Additional Back-slash ``\..`` Escaping needs to be activated by setting the ``BackSlashEscapeCharacter`` parser feature. JSQLParser reads Double Quotes ``".."`` as quoted identifiers (ANSI SQL); reading them as String Literals (BigQuery, Spark/Databricks, MySQL default sql_mode) needs the ``DoubleQuotedStrings`` parser feature.
282
+
JSQLParser allows for standard compliant Single Quote ``'..`` Escaping. Additional Back-slash ``\..`` Escaping needs to be activated by setting the ``BackSlashEscapeCharacter`` parser feature. JSQLParser reads Double Quotes ``".."`` as quoted identifiers (ANSI SQL); reading them as String Literals (BigQuery, Spark/Databricks, MySQL default sql_mode) needs the ``DoubleQuotedStrings`` parser feature. Adjacent String Literals concatenate optionally: only across a newline (``NEWLINE``, the SQL standard and PostgreSQL) or across any whitespace (``WHITESPACE``, GoogleSQL and Spark/Databricks); ``withAdjacentStringLiterals(true)`` selects the standard ``NEWLINE`` mode, ``false`` switches it off.
283
283
284
284
Additionally there are Features to control the Parser's effort at the cost of the performance.
285
285
@@ -319,7 +319,7 @@ Additionally there are Features to control the Parser's effort at the cost of th
319
319
.withBackslashEscapeCharacter(true)
320
320
);
321
321
322
-
Instead of turning the individual Parser Features on one by one, a ``Dialect`` preset selects the features of that database dialect: ``withDialect(Dialect.MYSQL)`` turns on ``withBackslashEscapeCharacter``, ``withHashLineComments`` and ``withDoubleQuotedStrings`` (MySQL and MariaDB syntax, the latter for the default sql_mode), ``withDialect(Dialect.SQLSERVER)`` turns on ``withSquareBracketQuotation``. Features set explicitly after the dialect preset win over the preset.
322
+
Instead of turning the individual Parser Features on one by one, a ``Dialect`` preset selects the features of that database dialect: ``withDialect(Dialect.MYSQL)`` turns on ``withBackslashEscapeCharacter``, ``withHashLineComments`` and ``withDoubleQuotedStrings`` (MySQL and MariaDB syntax, the latter for the default sql_mode), ``withDialect(Dialect.SQLSERVER)`` turns on ``withSquareBracketQuotation``. ``withDialect(Dialect.POSTGRESQL)`` and ``withDialect(Dialect.ANSI_SQL)`` turn on the newline rule for adjacent String Literals. Features set explicitly after the dialect preset win over the preset.
0 commit comments