1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 01:47:01 +03:00

Handle all the unimplemented cases with a helper.

This commit is contained in:
Rob Rix 2019-06-19 10:37:11 -04:00
parent 1164c87b01
commit cf8b344efc
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -65,15 +65,9 @@ instance Compile Py.FunctionDefinition where
where params = case parameters of
Nothing -> pure []
Just p -> traverse param [p] -- FIXME: this is wrong in node-types.json, @p@ should already be a list
param (Left Py.AnonymousComma{}) = fail "lol what"
param (Right (Left Py.DefaultParameter{..})) = fail "lol what"
param (Right (Right (Left Py.DictionarySplat{..}))) = fail "lol what"
param (Right (Right (Right (Left (Py.Identifier name))))) = pure (User name)
param (Right (Right (Right (Right (Left Py.KeywordIdentifier{..}))))) = fail "lol what"
param (Right (Right (Right (Right (Right (Left Py.ListSplat{..})))))) = fail "lol what"
param (Right (Right (Right (Right (Right (Right (Left Py.Tuple{..}))))))) = fail "lol what"
param (Right (Right (Right (Right (Right (Right (Right (Left Py.TypedDefaultParameter{..})))))))) = fail "lol what"
param (Right (Right (Right (Right (Right (Right (Right (Right Py.TypedParameter{..})))))))) = fail "lol what"
param x = unimplemented x
unimplemented x = fail $ "unimplemented: " <> show x
instance Compile Py.FutureImportStatement
instance Compile Py.GeneratorExpression