forked from extern/nushell
add ansi escape (#4772)
* add ansi escape * also add the ability to escape parens * add a few more escapes that could be problematic for the nushell lang
This commit is contained in:
parent
073f8655eb
commit
35ff1076f3
@ -2168,10 +2168,54 @@ pub fn unescape_string(bytes: &[u8], span: Span) -> (Vec<u8>, Option<ParseError>
|
||||
output.push(b'/');
|
||||
idx += 1;
|
||||
}
|
||||
Some(b'(') => {
|
||||
output.push(b'(');
|
||||
idx += 1;
|
||||
}
|
||||
Some(b')') => {
|
||||
output.push(b')');
|
||||
idx += 1;
|
||||
}
|
||||
Some(b'{') => {
|
||||
output.push(b'{');
|
||||
idx += 1;
|
||||
}
|
||||
Some(b'}') => {
|
||||
output.push(b'}');
|
||||
idx += 1;
|
||||
}
|
||||
Some(b'$') => {
|
||||
output.push(b'$');
|
||||
idx += 1;
|
||||
}
|
||||
Some(b'^') => {
|
||||
output.push(b'^');
|
||||
idx += 1;
|
||||
}
|
||||
Some(b'#') => {
|
||||
output.push(b'#');
|
||||
idx += 1;
|
||||
}
|
||||
Some(b'|') => {
|
||||
output.push(b'|');
|
||||
idx += 1;
|
||||
}
|
||||
Some(b'~') => {
|
||||
output.push(b'~');
|
||||
idx += 1;
|
||||
}
|
||||
Some(b'a') => {
|
||||
output.push(0x7);
|
||||
idx += 1;
|
||||
}
|
||||
Some(b'b') => {
|
||||
output.push(0x8);
|
||||
idx += 1;
|
||||
}
|
||||
Some(b'e') => {
|
||||
output.push(0x1b);
|
||||
idx += 1;
|
||||
}
|
||||
Some(b'f') => {
|
||||
output.push(0xc);
|
||||
idx += 1;
|
||||
|
Loading…
Reference in New Issue
Block a user