Add support for crlf for line continuations (#341)

This commit is contained in:
JT 2021-11-16 07:33:33 +13:00 committed by GitHub
parent e324c1a078
commit 42367ddf6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View File

@ -37,6 +37,7 @@
- [x] Support for `$in`
- [x] config system
- [ ] shells
- [ ] autoenv
- [ ] plugins
- [ ] dataframes
- [ ] port over `which` logic

View File

@ -1310,7 +1310,7 @@ pub fn parse_full_cell_path(
let source = working_set.get_span_contents(span);
let mut error = None;
let (tokens, err) = lex(source, span.start, &[b'\n'], &[b'.']);
let (tokens, err) = lex(source, span.start, &[b'\n', b'\r'], &[b'.']);
error = error.or(err);
let mut tokens = tokens.into_iter().peekable();
@ -1335,7 +1335,7 @@ pub fn parse_full_cell_path(
let source = working_set.get_span_contents(span);
let (output, err) = lex(source, span.start, &[b'\n'], &[]);
let (output, err) = lex(source, span.start, &[b'\n', b'\r'], &[]);
error = error.or(err);
let (output, err) = lite_parse(&output);
@ -2035,7 +2035,7 @@ pub fn parse_signature_helper(
let mut error = None;
let source = working_set.get_span_contents(span);
let (output, err) = lex(source, span.start, &[b'\n', b','], &[b':']);
let (output, err) = lex(source, span.start, &[b'\n', b'\r', b','], &[b':']);
error = error.or(err);
let mut args: Vec<Arg> = vec![];
@ -2364,7 +2364,7 @@ pub fn parse_list_expression(
let span = Span { start, end };
let source = working_set.get_span_contents(span);
let (output, err) = lex(source, span.start, &[b'\n', b','], &[]);
let (output, err) = lex(source, span.start, &[b'\n', b'\r', b','], &[]);
error = error.or(err);
let (output, err) = lite_parse(&output);
@ -2436,7 +2436,7 @@ pub fn parse_table_expression(
let source = working_set.get_span_contents(span);
let (output, err) = lex(source, start, &[b'\n', b','], &[]);
let (output, err) = lex(source, start, &[b'\n', b'\r', b','], &[]);
error = error.or(err);
let (output, err) = lite_parse(&output);
@ -2770,7 +2770,7 @@ pub fn parse_value(
let source = working_set.get_span_contents(span);
let mut error = None;
let (tokens, err) = lex(source, span.start, &[b'\n'], &[b'.']);
let (tokens, err) = lex(source, span.start, &[b'\n', b'\r'], &[b'.']);
error = error.or(err);
let tokens = tokens.into_iter().peekable();
@ -3205,7 +3205,7 @@ pub fn parse_record(
let span = Span { start, end };
let source = working_set.get_span_contents(span);
let (tokens, err) = lex(source, start, &[b'\n', b','], &[b':']);
let (tokens, err) = lex(source, start, &[b'\n', b'\r', b','], &[b':']);
error = error.or(err);
let mut output = vec![];