* Unquoted heredoc delimiter chars. Bash accepts most non-metacharacters — * not just identifiers. Stop at whitespace, redirects, pipe/list operators, * and structural tokens. Allows !, -, ., +, etc. (e.g. <<!HEREDOC!).
(c: string)
| 250 | * and structural tokens. Allows !, -, ., +, etc. (e.g. <<!HEREDOC!). |
| 251 | */ |
| 252 | function isHeredocDelimChar(c: string): boolean { |
| 253 | return ( |
| 254 | c !== '' && |
| 255 | c !== ' ' && |
| 256 | c !== '\t' && |
| 257 | c !== '\n' && |
| 258 | c !== '<' && |
| 259 | c !== '>' && |
| 260 | c !== '|' && |
| 261 | c !== '&' && |
| 262 | c !== ';' && |
| 263 | c !== '(' && |
| 264 | c !== ')' && |
| 265 | c !== "'" && |
| 266 | c !== '"' && |
| 267 | c !== '`' && |
| 268 | c !== '\\' |
| 269 | ) |
| 270 | } |
| 271 | |
| 272 | function skipBlanks(L: Lexer): void { |
| 273 | while (L.i < L.len) { |