Helper: return the concatenation of characters that appear outside POSIX single-quoted runs. Used by the metacharacter assertions above.
(s: &str)
| 1215 | /// Helper: return the concatenation of characters that appear outside |
| 1216 | /// POSIX single-quoted runs. Used by the metacharacter assertions above. |
| 1217 | fn outside_single_quotes(s: &str) -> String { |
| 1218 | let mut out = String::new(); |
| 1219 | let mut inside = false; |
| 1220 | for c in s.chars() { |
| 1221 | if c == '\'' { |
| 1222 | inside = !inside; |
| 1223 | continue; |
| 1224 | } |
| 1225 | if !inside { |
| 1226 | out.push(c); |
| 1227 | } |
| 1228 | } |
| 1229 | out |
| 1230 | } |
| 1231 | |
| 1232 | #[test] |
| 1233 | fn build_sandbox_notes_with_forwards() { |