More fixes towards invalid tabs.

This commit is contained in:
Ethiraric 2023-12-25 23:48:32 +01:00
parent 49bfa590a6
commit 5437f5d9cb
2 changed files with 6 additions and 3 deletions

View file

@ -1819,6 +1819,12 @@ impl<T: Iterator<Item = char>> Scanner<T> {
while is_blank(self.look_ch()) || is_break(self.ch()) { while is_blank(self.look_ch()) || is_break(self.ch()) {
if is_blank(self.ch()) { if is_blank(self.ch()) {
if leading_blanks && (self.mark.col as isize) < indent && self.ch() == '\t' { if leading_blanks && (self.mark.col as isize) < indent && self.ch() == '\t' {
// If our line contains only whitespace, this is not an error.
// Skip over it.
self.skip_ws_to_eol(SkipTabs::Yes);
if is_breakz(self.ch()) {
continue;
}
return Err(ScanError::new( return Err(ScanError::new(
start_mark, start_mark,
"while scanning a plain scalar, found a tab", "while scanning a plain scalar, found a tab",

View file

@ -299,10 +299,7 @@ fn expected_events(expected_tree: &str) -> Vec<String> {
static EXPECTED_FAILURES: &[&str] = &[ static EXPECTED_FAILURES: &[&str] = &[
// These seem to be plain bugs // These seem to be plain bugs
// TAB as start of plain scalar instead of whitespace // TAB as start of plain scalar instead of whitespace
"Y79Y-04", // unexpected pass
"Y79Y-05", // unexpected pass
// TABs in whitespace-only lines // TABs in whitespace-only lines
"DK95-04",
// TABs after marker ? or : (space required?) // TABs after marker ? or : (space required?)
"Y79Y-07", "Y79Y-07",
"Y79Y-09", "Y79Y-09",