1
1
mirror of https://github.com/github/semantic.git synced 2024-12-21 13:51:44 +03:00

🔥 the >>=!

This commit is contained in:
Rick Winfrey 2017-07-12 10:02:55 -07:00
parent 10a0efcf0b
commit 934cb445b0

View File

@ -179,9 +179,9 @@ parameter = makeTerm <$> symbol DefaultParameter <*> children (Statement.Assign
<|> makeTerm <$> symbol ListSplatParameter <*> (Syntax.Identifier <$> source)
<|> makeTerm <$> symbol DictionarySplatParameter <*> (Syntax.Identifier <$> source)
<|> makeTerm <$> symbol TypedParameter <*> children (Type.Annotation <$> identifier <*> type')
<|> (symbol TypedDefaultParameter >>= \ loc -> children (makeAnnotation loc <$> expression <*> expression <*> expression))
<|> makeAnnotation <$> symbol TypedDefaultParameter <*> children ((,,) <$> expression <*> expression <*> expression)
where
makeAnnotation loc identifier' type' value' = makeTerm loc (Type.Annotation (makeAssignment loc identifier' value') type')
makeAnnotation loc (identifier', type', value') = makeTerm loc (Type.Annotation (makeAssignment loc identifier' value') type')
makeAssignment loc identifier' value' = makeTerm loc (Statement.Assignment identifier' value')
decoratedDefinition :: Assignment