Add no_inidex feature to disable arrays and indexing.

This commit is contained in:
Stephen Chung
2020-03-10 17:10:33 +08:00
parent f3bcb2a10d
commit 52b5732bcb
10 changed files with 225 additions and 145 deletions

View File

@@ -173,6 +173,12 @@ impl From<ParseError> for EvalAltResult {
}
}
impl<T: AsRef<str>> From<T> for EvalAltResult {
fn from(err: T) -> Self {
Self::ErrorRuntime(err.as_ref().to_string(), Position::none())
}
}
impl EvalAltResult {
pub fn position(&self) -> Position {
match self {
@@ -225,9 +231,3 @@ impl EvalAltResult {
}
}
}
impl<T: AsRef<str>> From<T> for EvalAltResult {
fn from(err: T) -> Self {
Self::ErrorRuntime(err.as_ref().to_string(), Position::none())
}
}