From df18e6cb21c025266716ffff3be5ce17390bec1f Mon Sep 17 00:00:00 2001 From: xiaowei Date: Wed, 8 Sep 2021 20:22:46 +0800 Subject: [PATCH] feat: support custom variables ${} --- src/grammar/spark/SparkSql.g4 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/grammar/spark/SparkSql.g4 b/src/grammar/spark/SparkSql.g4 index bfe3791..ff9e0ba 100644 --- a/src/grammar/spark/SparkSql.g4 +++ b/src/grammar/spark/SparkSql.g4 @@ -1793,13 +1793,17 @@ BIGDECIMAL_LITERAL ; IDENTIFIER - : (LETTER | DIGIT | '_')+ + : (LETTER | DIGIT | '_' | CUSTOM_VARS)+ ; BACKQUOTED_IDENTIFIER : '`' ( ~'`' | '``' )* '`' ; +CUSTOM_VARS + : '${'(IDENTIFIER)'}' + ; + fragment DECIMAL_DIGITS : DIGIT+ '.' DIGIT* | '.' DIGIT+