marcusaram / snakeyaml

Automatically exported from code.google.com/p/snakeyaml
Apache License 2.0
1 stars 0 forks source link

Potential Patch submission #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
While waiting for my employers blessing,

How would you like a patch submission/discussion to happen?

It is about some flexibility with the API not about the Yaml parsing. 
Namely taking a valid yaml file translated to nodes, and then grabbing the
anchors before construction time and tweaking them as I please before
continuing with the regular construction process.

This provides runtime argument-like passing behaviour to happen in a valid
Yaml way.  One makes a yaml tree from a template.  And so on.

Original issue reported on code.google.com by shr...@gmail.com on 3 Nov 2009 at 12:18

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Feel free to put your patch here.
it would be convenient to see the desired effect of the patch in a test.

Original comment by aso...@gmail.com on 3 Nov 2009 at 6:23

GoogleCodeExporter commented 9 years ago
On an extended comment.  What I am doing is using the Yaml file as a human 
written
file format and not primarily a serialization format.  (No tag markups for 
example) 
And the ability to interpret the file for uses other than serialization.

I like your implementation because it works in two passes for customization.

TargetTree translate(SourceTree source)

What I desire to rewrite, is the second pass.  I want to be in possession of 
second
pass and still have the ability to validate and mutate the custom objects and
complain back to users about the content of their Yaml file with the correct 
context
information.

TreeNode[TargetTree, SourceTree] translate(SourceTree source)

Then all this highly informative structure can be crammed into a Builder 
patterns,
for example, to validate/complain in context.

It just so happens that my first investigation is to override anchors before the
second pass.  And therefore tweak the SourceTree with a Node delegate for 
anchors.

Where do you want to take SnakeYaml?

Original comment by shr...@gmail.com on 4 Nov 2009 at 2:28

GoogleCodeExporter commented 9 years ago
I am afraid I did not quite catch you.
This is the general design:
http://yaml.org/spec/1.1/#id859333

You can attach a Mercurial patch or source zip in here.

Original comment by aso...@gmail.com on 4 Nov 2009 at 3:32

GoogleCodeExporter commented 9 years ago
Since there is no feedback the issue is closed.

Original comment by aso...@gmail.com on 18 Nov 2009 at 3:00