Count b as a reference in ${a:b}

This commit is contained in:
Vidar Holen 2016-09-05 14:01:53 -07:00
parent 5a46eeb09a
commit a90b6d14b3
2 changed files with 11 additions and 1 deletions

View file

@ -474,11 +474,20 @@ getIndexReferences s = fromMaybe [] $ do
where
re = mkRegex "(\\[.*\\])"
getOffsetReferences mods = fromMaybe [] $ do
match <- matchRegex re mods
offsets <- match !!! 0
return $ matchAllStrings variableNameRegex offsets
where
re = mkRegex "^ *:(.*)"
getReferencedVariables parents t =
case t of
T_DollarBraced id l -> let str = bracedString t in
(t, t, getBracedReference str) :
map (\x -> (l, l, x)) (getIndexReferences str)
map (\x -> (l, l, x)) (
getIndexReferences str
++ getOffsetReferences (getBracedModifier str))
TA_Expansion id _ ->
if isArithmeticAssignment t
then []