Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

step line numbers are recorded when protocol is loaded (#65) #121

Merged
merged 3 commits into from
Mar 28, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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/hallettj/yaml-rust", branch = "load_from_str_with_markers" }
hallettj marked this conversation as resolved.
Show resolved Hide resolved
linked-hash-map = "*"
bincode = "*"
quale = "*"
Expand Down
32 changes: 32 additions & 0 deletions src/protocol/marker.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
use yaml_rust;

#[derive(Clone, Copy, PartialEq, PartialOrd, Debug, Eq, Ord, Hash)]
pub struct Marker {
pub line: usize,
pub col: usize,
}

impl Marker {
pub fn line(&self) -> usize {
let Marker { line, .. } = self;
*line
}
}

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