Store single native input tokens inline
This commit is contained in:
1 parent
9c93ff9750
commit
fb5cb5ada9
6 files changed
+64
-16
No files matched your search
@@ -38,7 +38,6 @@ impl Executor {
|
||||
let Some(input) = self.inputs.last_mut() else {
|
||||
return Ok(None);
|
||||
};
|
||||
let mut warnings = Vec::new();
|
||||
let next = match input {
|
||||
InputFrame::Tokens { tokens, cursor, .. } => {
|
||||
let t = tokens.get(*cursor).cloned();
|
||||
@@ -88,8 +87,8 @@ impl Executor {
|
||||
..
|
||||
} => {
|
||||
let token = mouth.next(&self.state, &mut self.reads);
|
||||
warnings = mouth.take_utf8_warnings();
|
||||
match token {
|
||||
let warnings = mouth.take_utf8_warnings();
|
||||
let next = match token {
|
||||
Ok(Some(token)) => {
|
||||
self.input_position = Some((*source, mouth.line_number()));
|
||||
Next::Token(Some(token.into()))
|
||||
@@ -123,7 +122,11 @@ impl Executor {
|
||||
}
|
||||
}
|
||||
Err((span, text)) => Next::Error(span, text),
|
||||
};
|
||||
if !warnings.is_empty() {
|
||||
self.observe_xe_utf8_warnings(warnings, files)?;
|
||||
}
|
||||
next
|
||||
}
|
||||
InputFrame::Hook { tokens, cursor, .. } => {
|
||||
let t = tokens.get(*cursor).cloned().map(InputToken::from);
|
||||
@@ -134,7 +137,6 @@ impl Executor {
|
||||
}
|
||||
InputFrame::Boundary => Next::Boundary,
|
||||
};
|
||||
self.observe_xe_utf8_warnings(warnings, files)?;
|
||||
match next {
|
||||
Next::Token(Some(token)) => {
|
||||
self.current = token.token.invocation.unwrap_or(token.token.span);
|
||||
|
||||
Reference in new issue
Block a user