aboutsummaryrefslogtreecommitdiff
path: root/src/ast_render.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-09-21 02:56:06 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-09-21 02:56:06 -0400
commitc2f3dc94eba85a32f3b7ab5857b33636a0a2e4df (patch)
treebb809f8eb6a1d7fb709607dcadce511b2a58dd8f /src/ast_render.cpp
parentc4a54377e3f07bbd2f9c54c1962c7941792c2c1f (diff)
parentee42caee0e6a24aa252845a72733007ed384d2bf (diff)
downloadzig-c2f3dc94eba85a32f3b7ab5857b33636a0a2e4df.tar.gz
zig-c2f3dc94eba85a32f3b7ab5857b33636a0a2e4df.zip
Merge branch 'c-to-zig'
Diffstat (limited to 'src/ast_render.cpp')
-rw-r--r--src/ast_render.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ast_render.cpp b/src/ast_render.cpp
index 1ac9d8de79..599d4b2659 100644
--- a/src/ast_render.cpp
+++ b/src/ast_render.cpp
@@ -14,8 +14,8 @@
static const char *bin_op_str(BinOpType bin_op) {
switch (bin_op) {
case BinOpTypeInvalid: return "(invalid)";
- case BinOpTypeBoolOr: return "||";
- case BinOpTypeBoolAnd: return "&&";
+ case BinOpTypeBoolOr: return "or";
+ case BinOpTypeBoolAnd: return "and";
case BinOpTypeCmpEq: return "==";
case BinOpTypeCmpNotEq: return "!=";
case BinOpTypeCmpLessThan: return "<";
@@ -580,10 +580,12 @@ static void render_node_extra(AstRender *ar, AstNode *node, bool grouped) {
break;
case NodeTypePrefixOpExpr:
{
+ if (!grouped) fprintf(ar->f, "(");
PrefixOp op = node->data.prefix_op_expr.prefix_op;
fprintf(ar->f, "%s", prefix_op_str(op));
render_node_ungrouped(ar, node->data.prefix_op_expr.primary_expr);
+ if (!grouped) fprintf(ar->f, ")");
break;
}
case NodeTypeAddrOfExpr: