Skip to content

Commit

Permalink
[fix] re #233: accept leading colon in UNK mode
Browse files Browse the repository at this point in the history
  • Loading branch information
biojppm committed Mar 21, 2022
1 parent 854d267 commit 5ae7409
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/c4/yml/parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void _parse_dump(DumpFn dumpfn, c4::csubstr fmt, Args&& ...args)

bool _is_scalar_next__runk(csubstr s)
{
return !(s.begins_with(": ") || s.begins_with_any("#,:{}[]%&") || s.begins_with("? ") || s == "-" || s.begins_with("- "));
return !(s.begins_with(": ") || s.begins_with_any("#,{}[]%&") || s.begins_with("? ") || s == "-" || s.begins_with("- ") || s.begins_with(":\"") || s.begins_with(":'"));
}

bool _is_scalar_next__rseq_rval(csubstr s)
Expand Down Expand Up @@ -2465,8 +2465,10 @@ bool Parser::_scan_scalar(csubstr *C4_RESTRICT scalar, bool *C4_RESTRICT quoted)
_c4dbgp("RUNK: no scalar next");
return false;
}
s = s.left_of(s.find(" #"));
size_t pos = s.find(": ");
size_t pos = s.find(" #");
if(pos != npos)
s = s.left_of(pos);
pos = s.find(": ");
if(pos != npos)
s = s.left_of(pos);
else if(s.ends_with(':'))
Expand Down

0 comments on commit 5ae7409

Please sign in to comment.