1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 02:44:36 +03:00

Correct Ruby’s Method pattern.

This commit is contained in:
Rob Rix 2017-01-20 15:25:53 -05:00
parent 438234b97d
commit 79a0386931

View File

@ -64,10 +64,11 @@ termAssignment source (_ :. category :. _ :. Nil) children
(For, lhs : expr : rest ) -> Just $ S.For [lhs, expr] rest
(OperatorAssignment, [ identifier, value ]) -> Just $ S.OperatorAssignment identifier value
(MemberAccess, [ base, property ]) -> Just $ S.MemberAccess base property
(Method, identifier : first : rest) | Params <- Info.category (extract first)
-> Just $ S.Method identifier Nothing (toList (unwrap first)) rest
| null rest
-> Just $ S.Method identifier Nothing [] [first]
(Method, identifier : rest) | params : body <- rest
, Params <- Info.category (extract params)
-> Just $ S.Method identifier Nothing (toList (unwrap params)) body
| otherwise
-> Just $ S.Method identifier Nothing [] rest
(Module, constant : body ) -> Just $ S.Module constant body
(Modifier Rescue, [lhs, rhs] ) -> Just $ S.Rescue [lhs] [rhs]
(Rescue, _ ) -> Just $ case children of