/^[^']*'[^']*$/{
/"[^'"]*'[^'"]*"/!bsqstring
}
+:folded
# here-doc -- swallow it
/<<[ ]*[-\\']*[A-Za-z0-9_]/bheredoc
# comment or empty line -- discard since final non-comment, non-empty line
# "$(...)" -- command substitution; not closing ")"
/\$([^)][^)]*)[^)]*$/bcheckchain
# multi-line "$(...\n...)" -- command substitution; treat as nested subshell
-/\$([ ]*$/bnest
+/\$([^)]*$/bnest
# "=(...)" -- Bash array assignment; not closing ")"
/=(/bcheckchain
# closing "...) &&"
N
s/\n//
/"/!bdqstring
-bcheckchain
+bfolded
# found multi-line single-quoted string '...\n...' -- slurp until end of string
:sqstring
N
s/\n//
/'/!bsqstring
-bcheckchain
+bfolded
# found here-doc -- swallow it to avoid false hits within its body (but keep
# the command to which it was attached)
}
s/^<[^>]*>//
s/\n.*$//
-bcheckchain
+bfolded
# found "case ... in" -- pass through untouched
:case