mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +03:00
ruby: allow operators as method names too
This commit is contained in:
parent
a39efb51b8
commit
210ff626f1
@ -313,9 +313,12 @@ methodCall = makeTerm' <$> symbol MethodCall <*> children (require <|> load <|>
|
||||
nameExpression = (symbol ArgumentList <|> symbol ArgumentListWithParens) *> children expression
|
||||
|
||||
methodSelector :: Assignment
|
||||
methodSelector = mk Identifier <|> mk Identifier' <|> mk Constant
|
||||
methodSelector = makeTerm <$> symbols <*> (Syntax.Identifier <$> (name <$> source))
|
||||
where
|
||||
mk s = makeTerm <$> symbol s <*> (Syntax.Identifier <$> (name <$> source))
|
||||
symbols = symbol Identifier
|
||||
<|> symbol Identifier'
|
||||
<|> symbol Constant
|
||||
<|> symbol Operator
|
||||
|
||||
call :: Assignment
|
||||
call = makeTerm <$> symbol Call <*> children (Ruby.Syntax.Send <$> (Just <$> term expression) <*> methodSelector <*> many expression <*> optional block)
|
||||
|
Loading…
Reference in New Issue
Block a user