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

appease hlint

This commit is contained in:
Charlie Somerville 2018-04-16 17:39:34 +10:00
parent 699e2642ff
commit 08a6b0a2d6

View File

@ -177,9 +177,7 @@ identifier =
where
mk s = makeTerm <$> symbol s <*> (Syntax.Identifier . name <$> source)
vcallOrLocal = do
loc <- symbol Identifier <|> symbol Identifier'
locals <- getRubyLocals
ident <- source
(loc, ident, locals) <- identWithLocals
let identTerm = makeTerm loc (Syntax.Identifier (name ident))
if ident `elem` locals
then pure identTerm
@ -410,11 +408,17 @@ assignment' = makeTerm <$> symbol Assignment <*> children (Statement.As
<|> lhsIdent
<|> expression
lhsIdent :: Assignment
lhsIdent = do
identWithLocals :: Assignment' (Record Location, ByteString, [ByteString])
identWithLocals = do
loc <- symbol Identifier <|> symbol Identifier'
-- source advances, so it's important we call getRubyLocals first
locals <- getRubyLocals
ident <- source
pure (loc, ident, locals)
lhsIdent :: Assignment
lhsIdent = do
(loc, ident, locals) <- identWithLocals
putRubyLocals (ident : locals)
pure $ makeTerm loc (Syntax.Identifier (name ident))