Warn about missing and invalid subscripts in array assignments.

This commit is contained in:
Vidar Holen 2016-12-28 18:58:03 -08:00
parent bd9d05c759
commit 5669702362
2 changed files with 46 additions and 2 deletions

View file

@ -297,7 +297,7 @@ getAssociativeArrays t =
f :: Token -> Writer [String] ()
f t@(T_SimpleCommand {}) = fromMaybe (return ()) $ do
name <- getCommandName t
guard $ name == "declare"
guard $ name == "declare" || name == "typeset"
let flags = getAllFlags t
guard $ elem "A" $ map snd flags
let args = map fst . filter ((==) "" . snd) $ flags