From 95fe3fea1698b0e690582cf529db4d76ae22ce6d Mon Sep 17 00:00:00 2001 From: Ethiraric Date: Sun, 13 Oct 2024 16:19:57 +0200 Subject: [PATCH] Fix issue with `---` in the middle of a scalar. This issue arises in the `yaml-test-suite` not in a test, but rather in the test description files themselves. Since we now use the library itself to load the test files, this made the `yaml-test-suite` fail. --- parser/src/scanner.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/parser/src/scanner.rs b/parser/src/scanner.rs index ba9a1cc..3fcbeb0 100644 --- a/parser/src/scanner.rs +++ b/parser/src/scanner.rs @@ -2176,7 +2176,10 @@ impl Scanner { loop { self.input.lookahead(4); - if self.input.next_is_document_indicator() || self.input.peek() == '#' { + if self.input.next_is_document_end() + || (self.input.next_is_document_start() && self.leading_whitespace) + || self.input.peek() == '#' + { break; }