mirror of
https://github.com/github/semantic.git
synced 2024-12-22 22:31:36 +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
|
nameExpression = (symbol ArgumentList <|> symbol ArgumentListWithParens) *> children expression
|
||||||
|
|
||||||
methodSelector :: Assignment
|
methodSelector :: Assignment
|
||||||
methodSelector = mk Identifier <|> mk Identifier' <|> mk Constant
|
methodSelector = makeTerm <$> symbols <*> (Syntax.Identifier <$> (name <$> source))
|
||||||
where
|
where
|
||||||
mk s = makeTerm <$> symbol s <*> (Syntax.Identifier <$> (name <$> source))
|
symbols = symbol Identifier
|
||||||
|
<|> symbol Identifier'
|
||||||
|
<|> symbol Constant
|
||||||
|
<|> symbol Operator
|
||||||
|
|
||||||
call :: Assignment
|
call :: Assignment
|
||||||
call = makeTerm <$> symbol Call <*> children (Ruby.Syntax.Send <$> (Just <$> term expression) <*> methodSelector <*> many expression <*> optional block)
|
call = makeTerm <$> symbol Call <*> children (Ruby.Syntax.Send <$> (Just <$> term expression) <*> methodSelector <*> many expression <*> optional block)
|
||||||
|
Loading…
Reference in New Issue
Block a user