(n *pg.A_Const)
| 96 | } |
| 97 | |
| 98 | func convertA_Const(n *pg.A_Const) *ast.A_Const { |
| 99 | if n == nil { |
| 100 | return nil |
| 101 | } |
| 102 | var val ast.Node |
| 103 | if n.Isnull { |
| 104 | val = &ast.Null{} |
| 105 | } else { |
| 106 | switch v := n.Val.(type) { |
| 107 | case *pg.A_Const_Boolval: |
| 108 | val = convertBoolean(v.Boolval) |
| 109 | case *pg.A_Const_Bsval: |
| 110 | val = convertBitString(v.Bsval) |
| 111 | case *pg.A_Const_Fval: |
| 112 | val = convertFloat(v.Fval) |
| 113 | case *pg.A_Const_Ival: |
| 114 | val = convertInteger(v.Ival) |
| 115 | case *pg.A_Const_Sval: |
| 116 | val = convertString(v.Sval) |
| 117 | } |
| 118 | } |
| 119 | return &ast.A_Const{ |
| 120 | Val: val, |
| 121 | Location: int(n.Location), |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | func convertA_Expr(n *pg.A_Expr) *ast.A_Expr { |
| 126 | if n == nil { |
no test coverage detected