1
1
mirror of https://github.com/github/semantic.git synced 2024-12-30 10:27:45 +03:00

Combine list splat parameter and arguments assignments

This commit is contained in:
Rick Winfrey 2017-07-11 15:43:26 -07:00
parent e61251f589
commit a83a6a7e49

View File

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