diff options
author | Anthon van der Neut <anthon@mnt.org> | 2023-05-06 12:29:03 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2023-05-06 12:29:03 +0200 |
commit | a7e27772f48e9e7f1040344739f680081da50a41 (patch) | |
tree | 0887b210272f81e1a01e6404e1e1aac25e4558f3 /scanner.py | |
parent | a4e09a2ba0d2adb1b2e63b6bf8fa39c055b9c99b (diff) | |
download | ruamel.yaml-a7e27772f48e9e7f1040344739f680081da50a41.tar.gz |
fix issue: 453, 4470.17.24
Diffstat (limited to 'scanner.py')
-rw-r--r-- | scanner.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -822,8 +822,9 @@ class Scanner: srf() found = False _the_end = _THE_END + white_space = ' \t' if self.flow_level > 0 else ' ' while not found: - while srp() == ' ': + while srp() in white_space: srf() if srp() == '#': while srp() not in _the_end: @@ -1837,14 +1838,14 @@ class RoundTripScanner(Scanner): # We also need to add the check for `allow_simple_keys == True` to # `unwind_indent` before issuing BLOCK-END. # Scanners for block, flow, and plain scalars need to be modified. - srp = self.reader.peek srf = self.reader.forward if self.reader.index == 0 and srp() == '\uFEFF': srf() found = False + white_space = ' \t' if self.flow_level > 0 else ' ' while not found: - while srp() == ' ': + while srp() in white_space: srf() ch = srp() if ch == '#': |