1
1
mirror of https://github.com/github/semantic.git synced 2025-01-05 05:58:34 +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 (VarAssignment, _) -> toVarAssignment children
(VarDecl, _) -> toVarAssignment children (VarDecl, _) -> toVarAssignment children
(If, _) -> toIfStatement children (If, _) -> toIfStatement children
(FunctionCall, _) -> withDefaultInfo $ case children of (FunctionCall, [id]) -> withDefaultInfo $ S.FunctionCall id []
[id] -> S.FunctionCall id [] (FunctionCall, id : rest) -> withDefaultInfo $ S.FunctionCall id rest
id : rest -> S.FunctionCall id rest
rest -> S.Error rest
(Other "const_declaration", _) -> toConsts children (Other "const_declaration", _) -> toConsts children
(AnonymousFunction, _) -> withDefaultInfo $ case children of (AnonymousFunction, _) -> withDefaultInfo $ case children of
[params, _, body] -> case toList (unwrap params) of [params, _, body] -> case toList (unwrap params) of