diff --git a/compiler/parse/src/number_literal.rs b/compiler/parse/src/number_literal.rs index 1e883eb850..139a9df1a3 100644 --- a/compiler/parse/src/number_literal.rs +++ b/compiler/parse/src/number_literal.rs @@ -107,7 +107,7 @@ fn chomp_number_dec<'a>( } } -fn chomp_number<'a>(mut bytes: &'a [u8]) -> (bool, usize) { +fn chomp_number(mut bytes: &[u8]) -> (bool, usize) { let start_bytes_len = bytes.len(); let mut is_float = false; diff --git a/compiler/parse/src/parser.rs b/compiler/parse/src/parser.rs index 029145454b..322f95a974 100644 --- a/compiler/parse/src/parser.rs +++ b/compiler/parse/src/parser.rs @@ -896,14 +896,14 @@ pub fn unexpected_eof<'a>( state: State<'a>, chars_consumed: usize, ) -> (Progress, SyntaxError<'a>, State<'a>) { - checked_unexpected(state, chars_consumed, |region| SyntaxError::Eof(region)) + checked_unexpected(state, chars_consumed, SyntaxError::Eof) } -pub fn unexpected<'a>( +pub fn unexpected( chars_consumed: usize, _attempting: Attempting, - state: State<'a>, -) -> (Progress, SyntaxError<'a>, State<'a>) { + state: State, +) -> (Progress, SyntaxError, State) { // NOTE state is the last argument because chars_consumed often depends on the state's fields // having state be the final argument prevents borrowing issues checked_unexpected(state, chars_consumed, |region| { @@ -946,7 +946,7 @@ where } } -fn line_too_long_e<'a, TE, E>(state: State<'a>, to_error: TE) -> (Progress, E, State<'a>) +fn line_too_long_e(state: State, to_error: TE) -> (Progress, E, State) where TE: Fn(Row, Col) -> E, { @@ -971,7 +971,7 @@ where (Progress::NoProgress, problem, state) } -fn line_too_long<'a>(state: State<'a>) -> (Progress, SyntaxError<'a>, State<'a>) { +fn line_too_long(state: State) -> (Progress, SyntaxError, State) { line_too_long_e(state, |line, _| SyntaxError::LineTooLong(line)) } diff --git a/compiler/parse/src/string_literal.rs b/compiler/parse/src/string_literal.rs index 7fd0575ef4..6c5d3e1564 100644 --- a/compiler/parse/src/string_literal.rs +++ b/compiler/parse/src/string_literal.rs @@ -151,6 +151,8 @@ pub fn parse<'a>() -> impl Parser<'a, StrLiteral<'a>, EString<'a>> { return Ok((MadeProgress, PlainLine(""), advance_state!(state, 1)?)); } } else { + // the string is non-empty, which means we need to convert any previous segments + // and the current segment into a string literal if is_multiline { if bytes.as_slice().starts_with(b"\"\"") { end_segment!(StrSegment::Plaintext);