提交 09b77884 编写于 作者: V Vidar Holen

Don't consider declare -Ffp assignments.

上级 ef2135f3
...@@ -2227,7 +2227,7 @@ getModifiedVariableCommand base@(T_SimpleCommand _ _ (T_NormalWord _ (T_Literal ...@@ -2227,7 +2227,7 @@ getModifiedVariableCommand base@(T_SimpleCommand _ _ (T_NormalWord _ (T_Literal
"export" -> "export" ->
if "f" `elem` flags then [] else concatMap getModifierParamString rest if "f" `elem` flags then [] else concatMap getModifierParamString rest
"declare" -> declaredVars "declare" -> if any (`elem` flags) ["F", "f", "p"] then [] else declaredVars
"typeset" -> declaredVars "typeset" -> declaredVars
"local" -> concatMap getModifierParamString rest "local" -> concatMap getModifierParamString rest
...@@ -2657,6 +2657,7 @@ prop_checkUnused22= verifyNotTree checkUnusedAssignments "a=1; [ -v a ]" ...@@ -2657,6 +2657,7 @@ prop_checkUnused22= verifyNotTree checkUnusedAssignments "a=1; [ -v a ]"
prop_checkUnused23= verifyNotTree checkUnusedAssignments "a=1; [ -R a ]" prop_checkUnused23= verifyNotTree checkUnusedAssignments "a=1; [ -R a ]"
prop_checkUnused24= verifyNotTree checkUnusedAssignments "mapfile -C a b; echo ${b[@]}" prop_checkUnused24= verifyNotTree checkUnusedAssignments "mapfile -C a b; echo ${b[@]}"
prop_checkUnused25= verifyNotTree checkUnusedAssignments "readarray foo; echo ${foo[@]}" prop_checkUnused25= verifyNotTree checkUnusedAssignments "readarray foo; echo ${foo[@]}"
prop_checkUnused26= verifyNotTree checkUnusedAssignments "declare -F foo"
checkUnusedAssignments params t = execWriter (mapM_ warnFor unused) checkUnusedAssignments params t = execWriter (mapM_ warnFor unused)
where where
flow = variableFlow params flow = variableFlow params
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册