mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 03:27:30 +08:00
Merge branch 'comment-backslash' of https://github.com/m-ildefons/shellcheck into m-ildefons-comment-backslash
This commit is contained in:
@@ -1039,9 +1039,14 @@ readComment = do
|
||||
unexpecting "shellcheck annotation" readAnnotationPrefix
|
||||
readAnyComment
|
||||
|
||||
prop_readAnyComment = isOk readAnyComment "# Comment"
|
||||
prop_readAnyComment1 = not $ isOk readAnyComment "# Comment \\\n"
|
||||
readAnyComment = do
|
||||
char '#'
|
||||
many $ noneOf "\r\n"
|
||||
comment <- many $ noneOf "\\\r\n"
|
||||
bs <- many $ oneOf "\\"
|
||||
unless (null bs) (fail "Backslash in or directly after comment")
|
||||
return comment
|
||||
|
||||
prop_readNormalWord = isOk readNormalWord "'foo'\"bar\"{1..3}baz$(lol)"
|
||||
prop_readNormalWord2 = isOk readNormalWord "foo**(foo)!!!(@@(bar))"
|
||||
|
Reference in New Issue
Block a user