You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the implementation of #18, YAML input is now streamed, or read token by token as it comes in. This makes supporting aliases/anchors a bit tricky as there isn't way to "back up" the pull parser when an alias is encountered.
Currently there are two way I can see to fix this.
Try to come up with something to keep track of/store the anchored elements and apply them when encountered again.
Revert Yaml.deserialize to simply use the previous logic of loading it into memory to do the conversion.
1 would be most ideal, but 2 wouldn't be the end of the world.
The text was updated successfully, but these errors were encountered:
After giving this some thought, I didn't really come up with any ideas for handling it in a streaming fashion. Plan for now is to replace the deserialize method with:
# OPTIMIZE: Figure out a way to handle aliases/anchors while streaming.defself.deserialize(input : IO, output : IO, **args) : NilYAML.parse(input).to_json output
end
PRs are welcome if anyone can come up with a solution that would allow for streaming as well.
With the implementation of #18, YAML input is now streamed, or read token by token as it comes in. This makes supporting aliases/anchors a bit tricky as there isn't way to "back up" the pull parser when an alias is encountered.
Currently there are two way I can see to fix this.
Yaml.deserialize
to simply use the previous logic of loading it into memory to do the conversion.1 would be most ideal, but 2 wouldn't be the end of the world.
The text was updated successfully, but these errors were encountered: