1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: fix test

This commit is contained in:
Joe Conigliaro 2020-03-23 02:30:45 +11:00
parent 076bc2b773
commit 99de98ffc7

View File

@ -48,11 +48,11 @@ void println(string s) {
}
void handle_expr(Expr e) {
if (e.typ == 25 /* IfExpr */) {
if (e.typ == 26 /* IfExpr */) {
IfExpr* it = (IfExpr*)e.obj; // ST it
println(tos3("if"));
}
else if (e.typ == 26 /* IntegerLiteral */) {
else if (e.typ == 27 /* IntegerLiteral */) {
IntegerLiteral* it = (IntegerLiteral*)e.obj; // ST it
println(tos3("integer"));
}
@ -73,7 +73,7 @@ int main(int argc, char** argv) {
Option_int n = get_opt();
int a = /*opt*/(*(int*)n.data) + 3;
handle_expr(/* sum type cast */ (Expr) {.obj = memdup(&(IfExpr[]) {(IfExpr){
0}}, sizeof(IfExpr)), .typ = 25 /* IfExpr */});
0}}, sizeof(IfExpr)), .typ = 26 /* IfExpr */});
return 0;
}