Use onlyLiteralString in more places

This commit is contained in:
Joseph C. Sible 2023-12-19 00:00:32 -05:00
parent a37803d2b8
commit f242922a2e
2 changed files with 5 additions and 5 deletions

View file

@ -186,7 +186,7 @@ checkCommand map t@(T_SimpleCommand id cmdPrefix (cmd:rest)) = sequence_ $ do
M.findWithDefault nullCheck (Basename $ basename name) map t
else if name == "builtin" && not (null rest) then
let t' = T_SimpleCommand id cmdPrefix rest
selectedBuiltin = fromMaybe "" $ getLiteralString . head $ rest
selectedBuiltin = onlyLiteralString $ head rest
in M.findWithDefault nullCheck (Exactly selectedBuiltin) map t'
else do
M.findWithDefault nullCheck (Exactly name) map t
@ -299,7 +299,7 @@ checkExpr = CommandCheck (Basename "expr") f where
"'expr' expects 3+ arguments but sees 1. Make sure each operator/operand is a separate argument, and escape <>&|."
[first, second] |
(fromMaybe "" $ getLiteralString first) /= "length"
onlyLiteralString first /= "length"
&& not (willSplit first || willSplit second) -> do
checkOp first
warn (getId t) 2307