This is an automated email from the ASF dual-hosted git repository.
morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.1 by this push:
new f070793fbde branch-3.1: [opt](parser) optimize parser perfermance of
STRING_LITERAL #53644 (#53680)
f070793fbde is described below
commit f070793fbdec159c3e1862d61dc23cb176201234
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Jul 22 12:49:12 2025 +0800
branch-3.1: [opt](parser) optimize parser perfermance of STRING_LITERAL
#53644 (#53680)
Cherry-picked from #53644
Co-authored-by: morrySnow <[email protected]>
---
fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisLexer.g4 | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisLexer.g4
b/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisLexer.g4
index a127880a5ff..a432c772c47 100644
--- a/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisLexer.g4
+++ b/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisLexer.g4
@@ -610,10 +610,8 @@ ATSIGN: '@';
DOUBLEATSIGN: '@@';
STRING_LITERAL
- : {!isNoBackslashEscapes}? '\'' ('\\'. | '\'\'' | ~('\'' | '\\'))* '\''
- | {isNoBackslashEscapes}? '\'' ('\'\'' | ~('\''))* '\''
- | {!isNoBackslashEscapes}?'"' ( '\\'. | '""' | ~('"'| '\\'))* '"'
- | {isNoBackslashEscapes}?'"' ('""' | ~('"'))* '"'
+ : '\'' ( {!isNoBackslashEscapes}? '\\'. | '\'\'' |
{!isNoBackslashEscapes}? ~('\'' | '\\') | {isNoBackslashEscapes}? ~('\''))* '\''
+ | '"' ( {!isNoBackslashEscapes}? '\\'. | '""' | {!isNoBackslashEscapes}?
~('"'| '\\') | {isNoBackslashEscapes}? ~('"'))* '"'
;
LEADING_STRING
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]