Skip to content

Commit

Permalink
[fix] re #289: scan flow scalars in seqs: look first for scalar..
Browse files Browse the repository at this point in the history
termination tokens before potential scans to the end of the line.
  • Loading branch information
biojppm committed Aug 18, 2022
1 parent 452aedf commit f73ae38
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/c4/yml/parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2335,6 +2335,11 @@ bool Parser::_scan_scalar(csubstr *C4_RESTRICT scalar, bool *C4_RESTRICT quoted)
_RYML_WITH_TAB_TOKENS(else if(s.begins_with("-\t"))
return false;
)
if(has_all(FLOW))
{
_c4dbgp("RSEQ|RVAL|EXPL");
s = s.left_of(s.first_of(",]"));
}
if(s.ends_with(':'))
{
--s.len;
Expand All @@ -2345,11 +2350,6 @@ bool Parser::_scan_scalar(csubstr *C4_RESTRICT scalar, bool *C4_RESTRICT quoted)
if(first)
s.len = first.pos;
}
if(has_all(FLOW))
{
_c4dbgp("RSEQ|RVAL|EXPL");
s = s.left_of(s.first_of(",]"));
}
s = s.trimr(_RYML_WITH_OR_WITHOUT_TAB_TOKENS(" \t", ' '));
}
else
Expand Down

0 comments on commit f73ae38

Please sign in to comment.