Skip to content
This repository was archived by the owner on Jun 3, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ path = "src/main.rs"
nix = "*"
libc = "*"
tempdir = "*"
yaml-rust = "*"
yaml-rust = { git = "https://github.com/originate/yaml-rust", rev = "5216abe1f7d24ccd17a3b1b1e56c0114758d5ed7" }
linked-hash-map = "*"
bincode = "*"
quale = "*"
Expand Down
25 changes: 25 additions & 0 deletions src/protocol/marker.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use yaml_rust;

#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct Marker {
pub line: usize,
pub col: usize,
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we implementing our own Marker and don't reuse the one from yaml-rust?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I construct Marker values in some tests. The fields in yaml_rust::Marker are private, and so is the constructor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, but shouldn't your changes to yaml-rust make those things public? If the first and only usage of the new yaml-rust version needs this to be public?


impl<'a> From<&'a yaml_rust::Marker> for Marker {
fn from(marker: &'a yaml_rust::Marker) -> Self {
Marker {
line: marker.line(),
col: marker.col(),
}
}
}

impl From<yaml_rust::Marker> for Marker {
fn from(marker: yaml_rust::Marker) -> Self {
Marker {
line: marker.line(),
col: marker.col(),
}
}
}
Loading