1
1
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:
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' 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