Skip to content

Commit

Permalink
Add UnaryExprOrTypeTraitExpr first child types to transpiler (#871)
Browse files Browse the repository at this point in the history
* Support UnaryExprOrTypeTraitExpr->CStyleCastExpr
* Support UnaryExprOrTypeTraitExpr->ConditionalOperator
* Support UnaryExprOrTypeTraitExpr->BinaryOperator
* Support UnaryExprOrTypeTraitExpr->IntegerLiteral
* Support UnaryExprOrTypeTraitExpr->StringLiteral

Fixes #784
Fixes #868
Fixes #869
Fixes #870
Fixes #823
  • Loading branch information
kroppt authored Jul 28, 2020
1 parent a1651b9 commit 5836250
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions transpiler/unary.go
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,21 @@ func transpileUnaryExprOrTypeTraitExpr(n *ast.UnaryExprOrTypeTraitExpr, p *progr
case *ast.CallExpr:
t = ty.Type

case *ast.CStyleCastExpr:
t = ty.Type

case *ast.ConditionalOperator:
t = ty.Type

case *ast.BinaryOperator:
t = ty.Type

case *ast.IntegerLiteral:
t = ty.Type

case *ast.StringLiteral:
t = ty.Type

default:
panic(fmt.Sprintf("cannot do unary on: %#v", ty))
}
Expand Down

1 comment on commit 5836250

@WNora
Copy link

@WNora WNora commented on 5836250 Sep 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

		case *ast.CStyleCastExpr:
			t = ty.Type

		case *ast.ConditionalOperator:
			t = ty.Type

		case *ast.BinaryOperator:
			t = ty.Type

		case *ast.IntegerLiteral:
			t = ty.Type

		case *ast.StringLiteral:
			t = ty.Type

Please sign in to comment.