Skip to content

Commit

Permalink
Accept FIELD[] in printf style debug()
Browse files Browse the repository at this point in the history
  • Loading branch information
totalspectrum committed Sep 15, 2023
1 parent 80cf305 commit b3b01c3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions backends/cpp/cppexpr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1704,6 +1704,13 @@ PrintExpr(Flexbuf *f, AST *expr, int flags)
PrintExpr(f, expr->right, flags);
flexbuf_printf(f, "; __tmp; } )");
break;
case AST_FIELDREF:
flexbuf_printf(f, "Field[");
PrintExpr(f, expr->left, flags);
flexbuf_printf(f, "][");
PrintExpr(f, expr->right, flags);
flexbuf_printf(f, "]");
break;
default:
ERROR(expr, "Internal error, bad expression");
break;
Expand Down

0 comments on commit b3b01c3

Please sign in to comment.