|
47 | 47 | # "?!AMP?!" violation is removed from the "bar" line (retrieved from the "hold"
|
48 | 48 | # area) since the final statement of a subshell must not end with "&&". The
|
49 | 49 | # final line of a subshell may still break the &&-chain by using ";" internally
|
50 |
| -# to chain commands together rather than "&&", so "?!SEMI?!" is never removed |
51 |
| -# from a line (even though "?!AMP?!" might be). |
| 50 | +# to chain commands together rather than "&&", so "?!SEMI?!" is not removed |
| 51 | +# from such a line; however, if the line ends with "?!SEMI?!", then the ";" is |
| 52 | +# harmless and the annotation is removed. |
52 | 53 | #
|
53 | 54 | # Care is taken to recognize the last _statement_ of a multi-line subshell, not
|
54 | 55 | # necessarily the last textual _line_ within the subshell, since &&-chaining
|
@@ -303,15 +304,15 @@ bcase
|
303 | 304 | # that line legitimately lacks "&&"
|
304 | 305 | :else
|
305 | 306 | x
|
306 |
| -s/ ?!AMP?!$// |
| 307 | +s/\( ?!SEMI?!\)* ?!AMP?!$// |
307 | 308 | x
|
308 | 309 | bcont
|
309 | 310 |
|
310 | 311 | # found "done" closing for-loop or while-loop, or "fi" closing if-then -- drop
|
311 | 312 | # "suspect" from final contained line since that line legitimately lacks "&&"
|
312 | 313 | :done
|
313 | 314 | x
|
314 |
| -s/ ?!AMP?!$// |
| 315 | +s/\( ?!SEMI?!\)* ?!AMP?!$// |
315 | 316 | x
|
316 | 317 | # is 'done' or 'fi' cuddled with ")" to close subshell?
|
317 | 318 | /done.*)/bclose
|
@@ -354,7 +355,7 @@ bblock
|
354 | 355 | # since that line legitimately lacks "&&" and exit subshell loop
|
355 | 356 | :clssolo
|
356 | 357 | x
|
357 |
| -s/ ?!AMP?!$// |
| 358 | +s/\( ?!SEMI?!\)* ?!AMP?!$// |
358 | 359 | p
|
359 | 360 | x
|
360 | 361 | s/^/>/
|
|
0 commit comments