This patch contains options to not skip yaml comments. If Yaml.setSkipComments(false) is called before reading a document the comments are parsed and returned. One can override Constructor and fetch them from Node them into custom objects.
Dear Martin, this is a very big change.
Not only it explicitly violates the specification, it also raises many questions.
- is there a commitment from you to answer community questions, fix issues and maintain the change ?
- can you create a manual/tutorial/description which will be included into the documentation ?
- if you consider this change incomplete, what are the steps to make it complete ?
- would you like to share your proposal in the general yaml-core mailing list ?
I am not interested in having and updating a fork to fit "my needs".
Actually I have a feature request to put some comments into the yaml files for administrators to see what they are editing in text editors.
And as I do not want to remove comments the user created for itself I looked for a fast way to access the comments during parsing without writing my own parser.
As CommentToken already was within snakeyml but seemed to not be in use yet, it seemed to be clever simply using it and patching.
Let me suggest the following: If you sahre a link to the mailing list and invite interested people in discussing it here I would be able to answer questions, complete the work etc.
I am not familiar with the specification itself and there may be other users but I should be able to help. Anyhow possible bugs will be fixed because I am not interested in having a buggy yml implementation as part of my Software ;-)
I registered with Mailing list and posted. Hope that worked because I do not see my post on the web link.
I will add more test cases at my fork. Some things did not work. Once my work is finished I will come back to you.
There is no need to hurry for me.
I preferr a clean and acceptable solution instead of hurrying.
Anyhow my fork will be part of my software in a relocated package because the main Software I am writing plugins already includes snakeyml in an older Version. I will increase number of test cases.
What to do if no one answers on mailing list in the next weeks/months?
I expected that other SnakeYAML developers should also find time and look into this proposal.
When we agree on big things we can discuss something smaller
(For instance that "protected boolean skipComments = true" should not be part of Yaml but LoaderOptions.)