1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00
This commit is contained in:
Rick Winfrey 2018-08-10 13:32:23 -07:00
parent 55eeddebe0
commit 5a8cf8dc67

View File

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