diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2022-07-29 13:10:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-29 13:10:11 +0200 |
| commit | ce72f77b455afa6a7de26b74de4ca539aeffecd6 (patch) | |
| tree | ad8c83890bca9aed2ba40d75162f0900a5507ee2 /src | |
| parent | 6c824e20abcd41ff02f3f6f296e6170cd77b8ee5 (diff) | |
| parent | 25af2b86c5c317c3a42c6d59ef42e29e4bc064d6 (diff) | |
Merge pull request #125 from nico-bb/master
Fix ternary when expression + added the test to snapshot
Diffstat (limited to 'src')
| -rw-r--r-- | src/odin/printer/visit.odin | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/odin/printer/visit.odin b/src/odin/printer/visit.odin index 04d1ada..a76ab47 100644 --- a/src/odin/printer/visit.odin +++ b/src/odin/printer/visit.odin @@ -1045,9 +1045,9 @@ visit_expr :: proc(p: ^Printer, expr: ^ast.Expr, called_from: Expr_Called_Type = document = cons_with_opl(document, group(visit_expr(p, v.y))) } case ^Ternary_When_Expr: - document = visit_expr(p, v.cond) + document = visit_expr(p, v.x) document = cons_with_nopl(document, text_token(p, v.op1)) - document = cons_with_nopl(document, visit_expr(p, v.x)) + document = cons_with_nopl(document, visit_expr(p, v.cond)) document = cons_with_nopl(document, text_token(p, v.op2)) document = cons_with_nopl(document, visit_expr(p, v.y)) case ^Or_Else_Expr: |