1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 04:51:57 +03:00

Flatten the FunctionCall patterns.

This commit is contained in:
Rob Rix 2017-01-23 12:41:51 -05:00
parent 918dcd0498
commit 5c9a9c8eb5

View File

@ -63,10 +63,8 @@ termAssignment source (range :. category :. sourceSpan :. Nil) children = Just $
(VarAssignment, _) -> toVarAssignment children
(VarDecl, _) -> toVarAssignment children
(If, _) -> toIfStatement children
(FunctionCall, _) -> withDefaultInfo $ case children of
[id] -> S.FunctionCall id []
id : rest -> S.FunctionCall id rest
rest -> S.Error rest
(FunctionCall, [id]) -> withDefaultInfo $ S.FunctionCall id []
(FunctionCall, id : rest) -> withDefaultInfo $ S.FunctionCall id rest
(Other "const_declaration", _) -> toConsts children
(AnonymousFunction, _) -> withDefaultInfo $ case children of
[params, _, body] -> case toList (unwrap params) of