rapidyaml icon indicating copy to clipboard operation
rapidyaml copied to clipboard

[Bug] Keys with ":" raise parsing error with parsing next blocks

Open Mr-S-Mirzoev opened this issue 1 year ago • 2 comments

Good time of the day there. I believe I'm able to reproduce the bug:

c: "proxy"
a:p_p:
  c: "clean"
  m: !<SomeClass> [/some/path]
a:d_d:
  c: "proxy"
  m: !<SomeClass> [/some/path]
image
-:8:4: (48B): ERROR: ': ' is not a valid token in plain flow (unquoted) scalars
-:8:4:   c: "clean"  (size=12)
          ^~~~~~~~~  (cols 4-13)

Indeed, it is some issue with keys with colons since the same yaml with keys without colons is parsed successfully by RYML:

c: "proxy"
p_p:
  c: "clean"
  m: !<SomeClass> [/some/path]
d_d:
  c: "proxy"
  m: !<SomeClass> [/some/path]
image

I also noticed that if you quote the keys, RYML parses successfully too.

c: "proxy"
"a:p_p":
  c: "clean"
  m: !<SomeClass> [/some/path]
"a:d_d":
  c: "proxy"
  m: !<SomeClass> [/some/path]
image

Also, if this helps, the library acts weird and fails in this example only on the second element with a colon-containing key:

a:p_p:
  c: "clean"
  m: !<SomeClass> [/some/path]
c: "text"
a:d_d:
  c: "proxy"
  m: !<SomeClass> [/some/path]
image

In case you don't see comments on this closed issue, let me mention you: @biojppm

Originally posted by @Mr-S-Mirzoev in https://github.com/biojppm/rapidyaml/issues/377#issuecomment-1587943459

Mr-S-Mirzoev avatar Jun 12 '23 19:06 Mr-S-Mirzoev

Thanks for the detailed description, it is helpful. Please hold for a fix (and expect some weeks for it to appear).

biojppm avatar Jul 04 '23 22:07 biojppm

This is likely fixed in the incoming parser refactor, #414.

biojppm avatar Apr 12 '24 18:04 biojppm