-
Notifications
You must be signed in to change notification settings - Fork 143
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
Scalar parser #37
base: master
Are you sure you want to change the base?
Scalar parser #37
Conversation
What do you think about this pr @chyh1990 ? |
The API enhancement looks good for me. One little problem, maybe we should move |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since @chyh1990 kindly mentioned me, I provided some comments. Keep in mind that I am neither familiar with Rust nor with this YAML implementation and my assumptions may be wrong.
examples/include_file_tag.rs
Outdated
impl<'a> yaml::YamlScalarParser for IncludeParser<'a> { | ||
fn parse_scalar(&self, tag: &scanner::TokenType, value: &str) -> Option<yaml::Yaml> { | ||
if let scanner::TokenType::Tag(ref handle, ref suffix) = *tag { | ||
if *handle == "!" && *suffix == "include" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line implies that the model for tag parsing implemented here differs from the YAML spec. A tag handle is nothing more but a shorthand to a URI prefix. The primary tag handle !
defaults to the URI prefix !
but may be redefined by a %TAG
directive, so if a tag !include
occurs somewhere in the source, it may resolve to the URI !include
, but also to my.fancy.uri.prefix:include
. Example:
%YAML 1.2
%TAG ! my.fancy.uri.prefix:
---
!include foo
For a parser to be spec-compliant, one needs to resolve all tags to URIs and then compare those URIs against whatever is expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks I don't know this feature of Yaml 1.2 spec
@chyh1990 How do you want to move dump_node as helper ? |
@chyh1990 the build is breaked https://travis-ci.org/chyh1990/yaml-rust/jobs/176486614 |
@chyh1990 any news about the build system ? |
@DeltaEvo you can try rebasing your pr, master passes CI now. |
@chyh1990 I think I'm unlucky |
@DeltaEvo Seems |
807435a
to
5f2d7e4
Compare
@chyh1990 The issue on clippy is fixed and I rebased my Pull Request |
merge failed ? |
I rebased this branch in a separate PR: #135 |
Given that #135 replaces this PR, should this PR be closed? |
I am not involved in this crate, since it is no longer used by serde_yaml. |
FWIW I've merged #135 (a rebased version of #37 (this PR)) into my fork: https://github.com/davvid/yaml-rust |
Fix #35