From 7e4d8b2fbbc33b7620ff38338a56d214e840ac5e Mon Sep 17 00:00:00 2001 From: Ayman Nadeem Date: Wed, 13 May 2020 11:32:51 -0400 Subject: [PATCH] Rb.Unless --- semantic-ruby/src/Language/Ruby/Tags.hs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/semantic-ruby/src/Language/Ruby/Tags.hs b/semantic-ruby/src/Language/Ruby/Tags.hs index 61f2a1a27..9d74ffe57 100644 --- a/semantic-ruby/src/Language/Ruby/Tags.hs +++ b/semantic-ruby/src/Language/Ruby/Tags.hs @@ -225,10 +225,14 @@ instance ToTags Rb.Elsif where _ -> pure () instance ToTags Rb.Unless where - tags Rb.Unless {condition, consequence, alternative} = do - tags condition - maybe (pure ()) tags consequence - maybe (pure ()) tags alternative + tags Rb.Unless {condition = Parse.Success cond, consequence, alternative} = do + tags cond + case consequence of + Just (Parse.Success cons) -> tags cons + _ -> pure () + case alternative of + Just (Parse.Success alt) -> tags alt + _ -> pure () instance ToTags Rb.While where tags Rb.While {condition, body} = tags condition >> tags body