finish up string problems

This commit is contained in:
Folkert 2021-02-26 22:11:28 +01:00
parent 2f4099f1f0
commit 5b3c7eeee3
4 changed files with 91 additions and 4 deletions

View file

@ -421,14 +421,13 @@ pub enum Number {
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum EString<'a> {
Open(Row, Col),
End,
CodePointOpen(Row, Col),
CodePointEnd(Row, Col),
Space(BadInputError, Row, Col),
EndlessSingle(Row, Col),
EndlessMulti,
EndlessMulti(Row, Col),
UnknownEscape(Row, Col),
Format(&'a SyntaxError<'a>, Row, Col),
}

View file

@ -311,7 +311,11 @@ pub fn parse<'a>() -> impl Parser<'a, StrLiteral<'a>, EString<'a>> {
// We ran out of characters before finding a closed quote
Err((
MadeProgress,
EString::EndlessSingle(state.line, state.column),
if is_multiline {
EString::EndlessMulti(state.line, state.column)
} else {
EString::EndlessSingle(state.line, state.column)
},
state,
))
}