Recognize declare -A statements when value is inlined.

This commit is contained in:
Vidar Holen 2016-06-26 14:57:52 -07:00
parent eb2472ada8
commit 07fd5724b8
2 changed files with 7 additions and 1 deletions

View file

@ -262,6 +262,11 @@ getAssociativeArrays t =
let flags = getAllFlags t
guard $ elem "A" $ map snd flags
let args = map fst . filter ((==) "" . snd) $ flags
let names = mapMaybe getLiteralString args
let names = mapMaybe (getLiteralStringExt nameAssignments) args
return $ tell names
f _ = return ()
nameAssignments t =
case t of
T_Assignment _ _ name _ _ -> return name
otherwise -> Nothing