diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2023-08-09 21:39:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-09 21:39:34 +0200 |
| commit | a67fe36cf772653f75f865c997818fcb3915f2f4 (patch) | |
| tree | 7f62c5cf614880e908254d4adc0a636c08fde5e9 /src | |
| parent | 46892948312c14b44600ae9f557e86bd8c792343 (diff) | |
| parent | 7423d507f41fbf156720c9827e34d32652cb57e0 (diff) | |
Merge pull request #238 from hwchen/hwchen/fix-switch-in
update for switch _ in
Diffstat (limited to 'src')
| -rw-r--r-- | src/odin/printer/visit.odin | 7 | ||||
| -rw-r--r-- | src/server/clone.odin | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/odin/printer/visit.odin b/src/odin/printer/visit.odin index 76120da..53ee19c 100644 --- a/src/odin/printer/visit.odin +++ b/src/odin/printer/visit.odin @@ -1154,7 +1154,12 @@ visit_stmt :: proc( //If the switch contains `switch in v` if exprs_contain_empty_idents(v.lhs) && block_type == .Switch_Stmt { - assign_document = cons(document, text(v.op.text)) + assign_document = cons( + document, + text("_"), + break_with_space(), + text(v.op.text), + ) } else { assign_document = cons( document, diff --git a/src/server/clone.odin b/src/server/clone.odin index def693f..e8cd090 100644 --- a/src/server/clone.odin +++ b/src/server/clone.odin @@ -94,7 +94,7 @@ clone_node :: proc( align = elem.align } - #partial switch in node.derived { + #partial switch _ in node.derived { case ^Package, ^File: panic("Cannot clone this node type") } |