Add `IsVar` trait instead of ambiguous `Into<Expr<Self>>` for `Symbol`
Closed this issue · 0 comments
bvssvni commented
Currently, there is a bug in the parser where replacing the inner type of Expr
leads to wrong results.
Should replace Into<Expr<Self>>
with an explicit trait:
/// Detect a variable when parsing.
pub trait IsVar {
/// Returns `true` if string is a variable.
fn is_var(val: &str) -> bool {
if let Some(c) = val.chars().next() {c.is_uppercase()} else {false}
}
}
The From<Arc<String>>
and From<&'static str>
impls should be removed from Expr<Arc<String>>
.