Fix a bunch of bugs

This commit is contained in:
Yehuda Katz
2019-06-23 18:55:31 -06:00
parent bed5ba52d3
commit 7957fc502f
10 changed files with 217 additions and 97 deletions

View File

@ -45,7 +45,7 @@ pub fn baseline_parse_next_expr(
let first = next_token(&mut tokens);
let first = match first {
None => return Err(ShellError::unimplemented("Expected token, found none")),
None => return Err(ShellError::string("Expected token, found none")),
Some(token) => baseline_parse_semantic_token(token, source)?,
};

View File

@ -1,8 +1,11 @@
use crate::Text;
use derive_new::new;
use getset::Getters;
use serde_derive::{Deserialize, Serialize};
#[derive(new, Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash, Getters)]
#[derive(
new, Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Serialize, Deserialize, Hash, Getters,
)]
#[get = "crate"]
pub struct Spanned<T> {
crate span: Span,
@ -46,7 +49,7 @@ impl<T> Spanned<T> {
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Hash)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Serialize, Deserialize, Hash)]
pub struct Span {
crate start: usize,
crate end: usize,