Better support arrays in arithmetic contexts. Fixes #1074

This commit is contained in:
Vidar Holen 2018-02-25 17:58:29 -08:00
parent 8d5e3a80ae
commit d16bf41c3d
5 changed files with 34 additions and 36 deletions

View file

@ -191,11 +191,9 @@ checkBashisms = ForShell [Sh, Dash] $ \t -> do
bashism (T_Glob id str) | "[^" `isInfixOf` str =
warnMsg id "^ in place of ! in glob bracket expressions is"
bashism t@(TA_Expansion id _) | isBashism =
warnMsg id $ fromJust str ++ " is"
where
str = getLiteralString t
isBashism = isJust str && isBashVariable (fromJust str)
bashism t@(TA_Variable id str _) | isBashVariable str =
warnMsg id $ str ++ " is"
bashism t@(T_DollarBraced id token) = do
mapM_ check expansion
when (isBashVariable var) $