Skip to content

Commit

Permalink
Fixed #Issue 51
Browse files Browse the repository at this point in the history
Added an else block to stop parsing a ScalarToken if Token doesn't contain a plain character after breaks or blanks
  • Loading branch information
adarshm-26 authored Mar 2, 2020
1 parent 54896b5 commit e816122
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/src/scanner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1460,6 +1460,10 @@ class Scanner {
buffer.write(whitespace);
whitespace.clear();
}
}
// After reading blanks or breaks, stop if Plain Character is not found
else {
break;
}

// libyaml's notion of valid identifiers differs substantially from YAML
Expand All @@ -1473,9 +1477,6 @@ class Scanner {

// Is it the end?
if (!_isBlank && !_isBreak) break;

// Flow mode scalars contain only one break or blank
if (!_inBlockContext && (_isBlank || _isBreak)) break;

while (_isBlank || _isBreak) {
if (_isBlank) {
Expand Down

0 comments on commit e816122

Please sign in to comment.