mirror of
https://github.com/github/semantic.git
synced 2024-11-24 08:54:07 +03:00
Simplify
This commit is contained in:
parent
55eeddebe0
commit
5a8cf8dc67
@ -471,9 +471,9 @@ methodDefinition = makeMethod <$>
|
||||
makeMethod loc (modifier, readonly, receiver, propertyName', (typeParameters', params, ty'), statements) = makeTerm loc (Declaration.Method [modifier, readonly, typeParameters', ty'] receiver propertyName' params statements)
|
||||
|
||||
callSignatureParts :: Assignment (Term, [Term], Term)
|
||||
callSignatureParts = contextualize' <$> Assignment.manyThrough comment (postContextualize'
|
||||
<$> (symbol Grammar.CallSignature *> children ((,,) <$> (fromMaybe <$> emptyTerm <*> optional (term typeParameters)) <*> formalParameters <*> (fromMaybe <$> emptyTerm <*> optional (term typeAnnotation')))) <*> many comment)
|
||||
callSignatureParts = contextualize' <$> Assignment.manyThrough comment (postContextualize' <$> callSignature' <*> many comment)
|
||||
where
|
||||
callSignature' = symbol Grammar.CallSignature *> children ((,,) <$> ((term typeParameters) <|> emptyTerm) <*> formalParameters <*> ((term typeAnnotation') <|> emptyTerm))
|
||||
contextualize' (cs, (typeParams, formalParams, annotation)) = case nonEmpty cs of
|
||||
Just cs -> (makeTerm1 (Syntax.Context cs typeParams), formalParams, annotation)
|
||||
Nothing -> (typeParams, formalParams, annotation)
|
||||
|
Loading…
Reference in New Issue
Block a user