mirror of
https://github.com/github/semantic.git
synced 2025-01-05 14:11:33 +03:00
ruby: emit Send terms from vcallOrLocal rather than Call
This commit is contained in:
parent
d08c675318
commit
c999557043
@ -180,9 +180,10 @@ identifier =
|
|||||||
loc <- symbol Identifier <|> symbol Identifier'
|
loc <- symbol Identifier <|> symbol Identifier'
|
||||||
locals <- getRubyLocals
|
locals <- getRubyLocals
|
||||||
ident <- source
|
ident <- source
|
||||||
|
let identTerm = makeTerm loc (Syntax.Identifier (name ident))
|
||||||
if ident `elem` locals
|
if ident `elem` locals
|
||||||
then pure $ makeTerm loc (Syntax.Identifier (name ident))
|
then pure identTerm
|
||||||
else makeTerm loc <$> (Expression.Call [] (makeTerm loc (Syntax.Identifier (name ident))) [] <$> emptyTerm)
|
else pure $ makeTerm loc (Ruby.Syntax.Send Nothing (Just identTerm) [] Nothing)
|
||||||
|
|
||||||
-- TODO: Handle interpolation in all literals that support it (strings, regexes, symbols, subshells, etc).
|
-- TODO: Handle interpolation in all literals that support it (strings, regexes, symbols, subshells, etc).
|
||||||
literal :: Assignment
|
literal :: Assignment
|
||||||
|
Loading…
Reference in New Issue
Block a user