@@ -218,6 +218,16 @@ public override void ExitBinaryOpExpr(MiniSqlParserParser.BinaryOpExprContext co
218218 op = ExpOperator . BitAnd ;
219219 } else if ( opType == MiniSqlParserLexer . PIPE ) {
220220 op = ExpOperator . BitOr ;
221+ } else if ( opType == MiniSqlParserLexer . ARROW ) {
222+ op = ExpOperator . GetJsonObj ;
223+ } else if ( opType == MiniSqlParserLexer . ARROW2 ) {
224+ op = ExpOperator . GetJsonObjAsText ;
225+ } else if ( opType == MiniSqlParserLexer . S_GT ) {
226+ op = ExpOperator . GetJsonPath ;
227+ } else if ( opType == MiniSqlParserLexer . S_GT2 ) {
228+ op = ExpOperator . GetJsonPathAsText ;
229+ } else if ( opType == MiniSqlParserLexer . S_MINUS ) {
230+ op = ExpOperator . DelJsonObj ;
221231 } else {
222232 throw new InvalidEnumArgumentException ( "Undefined ExpOperator is used"
223233 , ( int ) opType
@@ -308,6 +318,16 @@ public override void ExitSubQueryExpr(MiniSqlParserParser.SubQueryExprContext co
308318 _stack . Push ( node ) ;
309319 }
310320
321+ public override void ExitPostgreSqlCastExpr ( MiniSqlParserParser . PostgreSqlCastExprContext context ) {
322+ var comments = this . GetComments ( context ) ;
323+ var typeNameComment = this . GetComments ( context . type_name ( ) ) . Last ;
324+ comments . Insert ( 1 , typeNameComment ) ;
325+ var typeName = context . type_name ( ) . GetText ( ) ;
326+ var operand = ( Expr ) _stack . Pop ( ) ;
327+ var node = new CastExpr ( operand , typeName , true , comments ) ;
328+ _stack . Push ( node ) ;
329+ }
330+
311331 public override void ExitBitwiseNotExpr ( MiniSqlParserParser . BitwiseNotExprContext context ) {
312332 var comments = this . GetComments ( context ) ;
313333 var operand = ( Expr ) _stack . Pop ( ) ;
@@ -379,8 +399,7 @@ public override void ExitCastExpr(MiniSqlParserParser.CastExprContext context) {
379399 comments . Insert ( 3 , typeNameComment ) ;
380400 var typeName = context . type_name ( ) . GetText ( ) ;
381401 var operand = ( Expr ) _stack . Pop ( ) ;
382- var name = context . K_CAST ( ) . GetText ( ) ;
383- var node = new CastExpr ( operand , typeName , comments ) ;
402+ var node = new CastExpr ( operand , typeName , false , comments ) ;
384403 _stack . Push ( node ) ;
385404 }
386405
0 commit comments