Rename State::pos -> xyzlcol, temporarily

This commit is contained in:
Joshua Warner 2021-12-23 17:39:39 -08:00
parent bd7b1e5013
commit d2dcb462c7
10 changed files with 82 additions and 82 deletions

View file

@ -17,7 +17,7 @@ fn ascii_hex_digits<'a>() -> impl Parser<'a, &'a str, EString<'a>> {
buf.push(byte as char);
} else if buf.is_empty() {
// We didn't find any hex digits!
return Err((NoProgress, EString::CodePtEnd(state.pos), state));
return Err((NoProgress, EString::CodePtEnd(state.xyzlcol), state));
} else {
let state = state.advance_without_indenting_ee(buf.len(), |pos| {
EString::Space(BadInputError::LineTooLong, pos)
@ -27,7 +27,7 @@ fn ascii_hex_digits<'a>() -> impl Parser<'a, &'a str, EString<'a>> {
}
}
Err((NoProgress, EString::CodePtEnd(state.pos), state))
Err((NoProgress, EString::CodePtEnd(state.xyzlcol), state))
}
}
@ -56,7 +56,7 @@ pub fn parse<'a>() -> impl Parser<'a, StrLiteral<'a>, EString<'a>> {
bytes = state.bytes()[1..].iter();
state = advance_state!(state, 1)?;
} else {
return Err((NoProgress, EString::Open(state.pos), state));
return Err((NoProgress, EString::Open(state.xyzlcol), state));
}
// At the parsing stage we keep the entire raw string, because the formatter
@ -100,7 +100,7 @@ pub fn parse<'a>() -> impl Parser<'a, StrLiteral<'a>, EString<'a>> {
Err(_) => {
return Err((
MadeProgress,
EString::Space(BadInputError::BadUtf8, state.pos),
EString::Space(BadInputError::BadUtf8, state.xyzlcol),
state,
));
}
@ -192,7 +192,7 @@ pub fn parse<'a>() -> impl Parser<'a, StrLiteral<'a>, EString<'a>> {
// all remaining chars. This will mask all other errors, but
// it should make it easiest to debug; the file will be a giant
// error starting from where the open quote appeared.
return Err((MadeProgress, EString::EndlessSingle(state.pos), state));
return Err((MadeProgress, EString::EndlessSingle(state.xyzlcol), state));
}
}
b'\\' => {
@ -281,7 +281,7 @@ pub fn parse<'a>() -> impl Parser<'a, StrLiteral<'a>, EString<'a>> {
// Invalid escape! A backslash must be followed
// by either an open paren or else one of the
// escapable characters (\n, \t, \", \\, etc)
return Err((MadeProgress, EString::UnknownEscape(state.pos), state));
return Err((MadeProgress, EString::UnknownEscape(state.xyzlcol), state));
}
}
}
@ -295,9 +295,9 @@ pub fn parse<'a>() -> impl Parser<'a, StrLiteral<'a>, EString<'a>> {
Err((
MadeProgress,
if is_multiline {
EString::EndlessMulti(state.pos)
EString::EndlessMulti(state.xyzlcol)
} else {
EString::EndlessSingle(state.pos)
EString::EndlessSingle(state.xyzlcol)
},
state,
))