From a83a6a7e49d01c0fbda007cf2946e0f8a5ac2b7f Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Tue, 11 Jul 2017 15:43:26 -0700 Subject: [PATCH] Combine list splat parameter and arguments assignments --- src/Language/Python/Syntax.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Language/Python/Syntax.hs b/src/Language/Python/Syntax.hs index 0c0acbb8b..2d47afdc2 100644 --- a/src/Language/Python/Syntax.hs +++ b/src/Language/Python/Syntax.hs @@ -154,7 +154,7 @@ expression = await <|> expressionList <|> keywordArgument <|> keywordIdentifier - <|> listSplatParameter + <|> listSplat <|> literal <|> memberAccess <|> notOperator @@ -175,8 +175,9 @@ typedDefaultParameter = symbol TypedDefaultParameter >>= \ loc -> children (make makeAnnotation loc identifier' type' value' = makeTerm loc (Type.Annotation (makeAssignment loc identifier' value') type') makeAssignment loc identifier' value' = makeTerm loc (Statement.Assignment identifier' value') -listSplatParameter :: Assignment -listSplatParameter = makeTerm <$> symbol ListSplatParameter <*> (Syntax.Identifier <$> source) +listSplat :: Assignment +listSplat = makeTerm <$> symbol ListSplatParameter <*> (Syntax.Identifier <$> source) + <|> makeTerm <$> symbol ListSplatArgument <*> (Syntax.Identifier <$> source) dictionarySplat :: Assignment dictionarySplat = makeTerm <$> symbol DictionarySplatParameter <*> (Syntax.Identifier <$> source)