Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit cf8b344

Browse files
committed
Handle all the unimplemented cases with a helper.
1 parent 1164c87 commit cf8b344

File tree

1 file changed

+2
-8
lines changed
  • semantic-python/src/Language/Python

1 file changed

+2
-8
lines changed

semantic-python/src/Language/Python/Core.hs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,9 @@ instance Compile Py.FunctionDefinition where
6565
where params = case parameters of
6666
Nothing -> pure []
6767
Just p -> traverse param [p] -- FIXME: this is wrong in node-types.json, @p@ should already be a list
68-
param (Left Py.AnonymousComma{}) = fail "lol what"
69-
param (Right (Left Py.DefaultParameter{..})) = fail "lol what"
70-
param (Right (Right (Left Py.DictionarySplat{..}))) = fail "lol what"
7168
param (Right (Right (Right (Left (Py.Identifier name))))) = pure (User name)
72-
param (Right (Right (Right (Right (Left Py.KeywordIdentifier{..}))))) = fail "lol what"
73-
param (Right (Right (Right (Right (Right (Left Py.ListSplat{..})))))) = fail "lol what"
74-
param (Right (Right (Right (Right (Right (Right (Left Py.Tuple{..}))))))) = fail "lol what"
75-
param (Right (Right (Right (Right (Right (Right (Right (Left Py.TypedDefaultParameter{..})))))))) = fail "lol what"
76-
param (Right (Right (Right (Right (Right (Right (Right (Right Py.TypedParameter{..})))))))) = fail "lol what"
69+
param x = unimplemented x
70+
unimplemented x = fail $ "unimplemented: " <> show x
7771

7872
instance Compile Py.FutureImportStatement
7973
instance Compile Py.GeneratorExpression

0 commit comments

Comments
 (0)