pantoniou / libfyaml

Fully feature complete YAML parser and emitter, supporting the latest YAML spec and passing the full YAML testsuite.
MIT License
239 stars 73 forks source link

Problem: implementing custom comparison methods #85

Open yrashk opened 1 year ago

yrashk commented 1 year ago

While the comparison method to be created would benefit from being able to fall back onto the default implementation, it can't do so as these default methods are private to libfyaml and are not exposed.

Solution: make them available as a public interface

yrashk commented 1 year ago

@pantoniou have you had a chance to look at this, what do you think?

yrashk commented 1 year ago

Actually, I think there's an easier solution: just exposing int fy_token_cmp(struct fy_token *fyt1, struct fy_token *fyt2) in header files. This way, a custom comparator can use it.

I will send a separate PR.

yrashk commented 1 year ago

I sent #87 for this and I've also discovered a bug 🐛 in fy_compare_node_user, see #86