-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add clear_fmt_recursive method #45
Conversation
When comparing two different `KdlNode` or `KdlDocument`, it's useful to have a "canonical" representation where formatting differences do not matter. `clear_fmt` removes all formatting from a `KdlNode`, but does not apply recursively, as a result, it doesn't create a canonical representation. `clear_fmt_recursive` solves this by applying `clear_fmt` recursively to the contents of the node.
791e7ed
to
799223d
Compare
@zkat May I get your attention? You might have overlooked this PR. |
Oh sorry, I did miss this. So what you want here is to use something that will wipe out comments, not just format everything into a "standard" format? |
Yeah, I'd like to whip out comments. But it's not because I want to print it, it's more to do with equality and testing. The idea is to have a representation that only depends on the actual values of the nodes. It's useful for two things: testing and comparing two different KdlNode. The It's also useful for testing. The output of I wrote my own |
sgtm :) |
Fixes #46 When comparing two different `KdlNode` or `KdlDocument`, it's useful to have a "canonical" representation where formatting differences do not matter. `clear_fmt` removes all formatting from a `KdlNode`, but does not apply recursively, as a result, it doesn't create a canonical representation. `clear_fmt_recursive` solves this by applying `clear_fmt` recursively to the contents of the node.
this has been published as part of So great that you're using it! |
When comparing two different
KdlNode
orKdlDocument
, it's useful tohave a "canonical" representation where formatting differences do not
matter.
clear_fmt
removes all formatting from aKdlNode
, but does not applyrecursively, as a result, it doesn't create a canonical representation.
clear_fmt_recursive
solves this by applyingclear_fmt
recursively tothe contents of the node.