1
1
mirror of https://github.com/github/semantic.git synced 2024-12-28 09:21:35 +03:00

Readability

This commit is contained in:
Rick Winfrey 2018-08-10 14:02:06 -07:00
parent f272d604ca
commit 64f052eea8

View File

@ -804,8 +804,16 @@ shorthandPropertyIdentifier :: Assignment Term
shorthandPropertyIdentifier = makeTerm <$> symbol Grammar.ShorthandPropertyIdentifier <*> (TypeScript.Syntax.ShorthandPropertyIdentifier <$> source) shorthandPropertyIdentifier = makeTerm <$> symbol Grammar.ShorthandPropertyIdentifier <*> (TypeScript.Syntax.ShorthandPropertyIdentifier <$> source)
requiredParameter :: Assignment Term requiredParameter :: Assignment Term
requiredParameter = makeRequiredParameter <$> symbol Grammar.RequiredParameter <*> children ((,,,,) <$> (term accessibilityModifier' <|> emptyTerm) <*> (term readonly' <|> emptyTerm) <*> term (identifier <|> destructuringPattern <|> this) <*> (term typeAnnotation' <|> emptyTerm) <*> (term expression <|> emptyTerm)) requiredParameter = makeRequiredParameter
where makeRequiredParameter loc (modifier, readonly, identifier, annotation, initializer) = makeTerm loc (TypeScript.Syntax.RequiredParameter [modifier, readonly, annotation] (makeTerm loc (Statement.Assignment [] identifier initializer))) <$> symbol Grammar.RequiredParameter
<*> children ( (,,,,)
<$> (term accessibilityModifier' <|> emptyTerm)
<*> (term readonly' <|> emptyTerm)
<*> term (identifier <|> destructuringPattern <|> this)
<*> (term typeAnnotation' <|> emptyTerm)
<*> (term expression <|> emptyTerm))
where
makeRequiredParameter loc (modifier, readonly, identifier, annotation, initializer) = makeTerm loc (TypeScript.Syntax.RequiredParameter [modifier, readonly, annotation] (makeTerm loc (Statement.Assignment [] identifier initializer)))
restParameter :: Assignment Term restParameter :: Assignment Term
restParameter = makeRestParameter <$> symbol Grammar.RestParameter <*> children ((,) <$> term identifier <*> (term typeAnnotation' <|> emptyTerm)) restParameter = makeRestParameter <$> symbol Grammar.RestParameter <*> children ((,) <$> term identifier <*> (term typeAnnotation' <|> emptyTerm))