mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-15 01:23:07 -07:00
Warn about missing space in [ foo= bar ]
This commit is contained in:
parent
af87fe9315
commit
bd9d05c759
6 changed files with 62 additions and 21 deletions
|
@ -171,6 +171,20 @@ getUnquotedLiteral (T_NormalWord _ list) =
|
|||
str _ = Nothing
|
||||
getUnquotedLiteral _ = Nothing
|
||||
|
||||
-- Get the last unquoted T_Literal in a word like "${var}foo"THIS
|
||||
-- or nothing if the word does not end in an unquoted literal.
|
||||
getTrailingUnquotedLiteral :: Token -> Maybe Token
|
||||
getTrailingUnquotedLiteral t =
|
||||
case t of
|
||||
(T_NormalWord _ list@(_:_)) ->
|
||||
from (last list)
|
||||
_ -> Nothing
|
||||
where
|
||||
from t =
|
||||
case t of
|
||||
(T_Literal {}) -> return t
|
||||
_ -> Nothing
|
||||
|
||||
-- Maybe get the literal string of this token and any globs in it.
|
||||
getGlobOrLiteralString = getLiteralStringExt f
|
||||
where
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue