1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 13:02:37 +03:00

ruby: emit Send terms from vcallOrLocal rather than Call

This commit is contained in:
Charlie Somerville 2018-04-11 15:05:59 +10:00
parent d08c675318
commit c999557043

View File

@ -180,9 +180,10 @@ identifier =
loc <- symbol Identifier <|> symbol Identifier'
locals <- getRubyLocals
ident <- source
let identTerm = makeTerm loc (Syntax.Identifier (name ident))
if ident `elem` locals
then pure $ makeTerm loc (Syntax.Identifier (name ident))
else makeTerm loc <$> (Expression.Call [] (makeTerm loc (Syntax.Identifier (name ident))) [] <$> emptyTerm)
then pure identTerm
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).
literal :: Assignment