1
1
mirror of https://github.com/github/semantic.git synced 2025-01-05 22:28:10 +03:00

Rb.Unless

This commit is contained in:
Ayman Nadeem 2020-05-13 11:32:51 -04:00
parent 5fb36f4386
commit 7e4d8b2fbb

View File

@ -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