arina-ielchiieva commented on a change in pull request #1554: DRILL-6870: 
Upgrade to ANTLR4
URL: https://github.com/apache/drill/pull/1554#discussion_r235989187
 
 

 ##########
 File path: 
logical/src/main/antlr4/org/apache/drill/common/expression/parser/ExprParser.g4
 ##########
 @@ -55,25 +47,20 @@ import 
org.apache.drill.common.exceptions.ExpressionParsingException;
   public ExpressionPosition pos(Token token){
     return new ExpressionPosition(fullExpression, token.getTokenIndex());
   }
-  
-  @Override    
-  public void displayRecognitionError(String[] tokenNames, 
RecognitionException e) {
-       String hdr = getErrorHeader(e);
-    String msg = getErrorMessage(e, tokenNames);
-    throw new ExpressionParsingException("Expression has syntax error! " + hdr 
+ ":" + msg);
-  }
 }
 
 parse returns [LogicalExpression e]
   :  expression EOF {
-    $e = $expression.e; 
-    if(fullExpression == null) fullExpression = $expression.text;
+    $e = $expression.e;
+    if (fullExpression == null) fullExpression = $expression.text;
     tokenPos = $expression.start.getTokenIndex();
   }
   ;
  
 functionCall returns [LogicalExpression e]
-  :  Identifier OParen exprList? CParen {$e = 
FunctionCallFactory.createExpression($Identifier.text, pos($Identifier), 
$exprList.listE);  }
+  :  Identifier OParen exprList? CParen {$e =
+      FunctionCallFactory.createExpression($Identifier.text, pos($Identifier),
+        ($exprList.ctx == null ? new ArrayList<LogicalExpression>() : 
$exprList.listE)); }
 
 Review comment:
   Agree, removed in other places as well.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to