(n *chast.BinaryExpr)
| 447 | } |
| 448 | |
| 449 | func (c *cc) convertBinaryExpr(n *chast.BinaryExpr) ast.Node { |
| 450 | op := strings.ToUpper(n.Op) |
| 451 | |
| 452 | // Handle logical operators |
| 453 | if op == "AND" || op == "OR" { |
| 454 | var boolop ast.BoolExprType |
| 455 | if op == "AND" { |
| 456 | boolop = ast.BoolExprTypeAnd |
| 457 | } else { |
| 458 | boolop = ast.BoolExprTypeOr |
| 459 | } |
| 460 | return &ast.BoolExpr{ |
| 461 | Boolop: boolop, |
| 462 | Args: &ast.List{ |
| 463 | Items: []ast.Node{ |
| 464 | c.convertExpr(n.Left), |
| 465 | c.convertExpr(n.Right), |
| 466 | }, |
| 467 | }, |
| 468 | Location: n.Pos().Offset, |
| 469 | } |
| 470 | } |
| 471 | |
| 472 | // Handle other operators |
| 473 | return &ast.A_Expr{ |
| 474 | Name: &ast.List{ |
| 475 | Items: []ast.Node{&ast.String{Str: n.Op}}, |
| 476 | }, |
| 477 | Lexpr: c.convertExpr(n.Left), |
| 478 | Rexpr: c.convertExpr(n.Right), |
| 479 | Location: n.Pos().Offset, |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | func (c *cc) convertFunctionCall(n *chast.FunctionCall) *ast.FuncCall { |
| 484 | fc := &ast.FuncCall{ |
no test coverage detected