|
|
@ -75,80 +75,18 @@ impl<'a> Symbol for List<'a> { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a, A: 'a + Symbol, B: 'a + Symbol> From<(A, B)> for List<'a> {
|
|
|
|
fn from((a, b): (A, B)) -> Self {
|
|
|
|
Self::new(vec![Box::new(a), Box::new(b)])
|
|
|
|
macro_rules! from_tuple {
|
|
|
|
( $($name:ident)* ) => (
|
|
|
|
#[allow(non_snake_case)]
|
|
|
|
impl<'a, $($name: 'a + Symbol,)*> From<($($name,)*)> for List<'a> {
|
|
|
|
fn from(($($name,)*): ($($name,)*)) -> Self {
|
|
|
|
Self::new(vec![$(Box::new($name),)*])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a, A: 'a + Symbol, B: 'a + Symbol, C: 'a + Symbol> From<(A, B, C)> for List<'a> {
|
|
|
|
fn from((a, b, c): (A, B, C)) -> Self {
|
|
|
|
Self::new(vec![Box::new(a), Box::new(b), Box::new(c)])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[rustfmt::skip]
|
|
|
|
impl<'a, A: 'a + Symbol, B: 'a + Symbol, C: 'a + Symbol, D: 'a + Symbol> From<(A, B, C, D)> for List<'a> {
|
|
|
|
fn from((a, b, c, d): (A, B, C, D)) -> Self {
|
|
|
|
Self::new(vec![Box::new(a), Box::new(b), Box::new(c), Box::new(d)])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[rustfmt::skip]
|
|
|
|
impl<'a, A: 'a + Symbol, B: 'a + Symbol, C: 'a + Symbol, D: 'a + Symbol, E: 'a + Symbol> From<(A, B, C, D, E)> for List<'a> {
|
|
|
|
fn from((a, b, c, d, e): (A, B, C, D, E)) -> Self {
|
|
|
|
Self::new(vec![Box::new(a), Box::new(b), Box::new(c), Box::new(d), Box::new(e)])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[rustfmt::skip]
|
|
|
|
impl<'a, A: 'a + Symbol, B: 'a + Symbol, C: 'a + Symbol, D: 'a + Symbol, E: 'a + Symbol, F: 'a + Symbol> From<(A, B, C, D, E, F)> for List<'a> {
|
|
|
|
fn from((a, b, c, d, e, f): (A, B, C, D, E, F)) -> Self {
|
|
|
|
Self::new(vec![Box::new(a), Box::new(b), Box::new(c), Box::new(d), Box::new(e), Box::new(f)])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[rustfmt::skip]
|
|
|
|
impl<'a, A: 'a + Symbol, B: 'a + Symbol, C: 'a + Symbol, D: 'a + Symbol, E: 'a + Symbol, F: 'a + Symbol, G: 'a + Symbol> From<(A, B, C, D, E, F, G)> for List<'a> {
|
|
|
|
fn from((a, b, c, d, e, f, g): (A, B, C, D, E, F, G)) -> Self {
|
|
|
|
Self::new(vec![Box::new(a), Box::new(b), Box::new(c), Box::new(d), Box::new(e), Box::new(f), Box::new(g)])
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[rustfmt::skip]
|
|
|
|
impl<'a, A: 'a + Symbol, B: 'a + Symbol, C: 'a + Symbol, D: 'a + Symbol, E: 'a + Symbol, F: 'a + Symbol, G: 'a + Symbol, H: 'a + Symbol> From<(A, B, C, D, E, F, G, H)> for List<'a> {
|
|
|
|
fn from((a, b, c, d, e, f, g, h): (A, B, C, D, E, F, G, H)) -> Self {
|
|
|
|
Self::new(vec![Box::new(a), Box::new(b), Box::new(c), Box::new(d), Box::new(e), Box::new(f), Box::new(g), Box::new(h)])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[rustfmt::skip]
|
|
|
|
impl<'a, A: 'a + Symbol, B: 'a + Symbol, C: 'a + Symbol, D: 'a + Symbol, E: 'a + Symbol, F: 'a + Symbol, G: 'a + Symbol, H: 'a + Symbol, I: 'a + Symbol, J: 'a + Symbol, K: 'a + Symbol> From<(A, B, C, D, E, F, G, H, I, J, K)> for List<'a> {
|
|
|
|
fn from((a, b, c, d, e, f, g, h, i, j, k): (A, B, C, D, E, F, G, H, I, J, K)) -> Self {
|
|
|
|
Self::new(vec![Box::new(a), Box::new(b), Box::new(c), Box::new(d), Box::new(e), Box::new(f), Box::new(g), Box::new(h), Box::new(i), Box::new(j), Box::new(k)])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[rustfmt::skip]
|
|
|
|
impl<'a, A: 'a + Symbol, B: 'a + Symbol, C: 'a + Symbol, D: 'a + Symbol, E: 'a + Symbol, F: 'a + Symbol, G: 'a + Symbol, H: 'a + Symbol, I: 'a + Symbol, J: 'a + Symbol, K: 'a + Symbol, L: 'a + Symbol> From<(A, B, C, D, E, F, G, H, I, J, K, L)> for List<'a> {
|
|
|
|
fn from((a, b, c, d, e, f, g, h, i, j, k, l): (A, B, C, D, E, F, G, H, I, J, K, L)) -> Self {
|
|
|
|
Self::new(vec![Box::new(a), Box::new(b), Box::new(c), Box::new(d), Box::new(e), Box::new(f), Box::new(g), Box::new(h), Box::new(i), Box::new(j), Box::new(k), Box::new(l)])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[rustfmt::skip]
|
|
|
|
impl<'a, A: 'a + Symbol, B: 'a + Symbol, C: 'a + Symbol, D: 'a + Symbol, E: 'a + Symbol, F: 'a + Symbol, G: 'a + Symbol, H: 'a + Symbol, I: 'a + Symbol, J: 'a + Symbol, K: 'a + Symbol, L: 'a + Symbol, M: 'a + Symbol> From<(A, B, C, D, E, F, G, H, I, J, K, L, M)> for List<'a> {
|
|
|
|
fn from((a, b, c, d, e, f, g, h, i, j, k, l, m): (A, B, C, D, E, F, G, H, I, J, K, L, M)) -> Self {
|
|
|
|
Self::new(vec![Box::new(a), Box::new(b), Box::new(c), Box::new(d), Box::new(e), Box::new(f), Box::new(g), Box::new(h), Box::new(i), Box::new(j), Box::new(k), Box::new(l), Box::new(m)])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[rustfmt::skip]
|
|
|
|
impl<'a, A: 'a + Symbol, B: 'a + Symbol, C: 'a + Symbol, D: 'a + Symbol, E: 'a + Symbol, F: 'a + Symbol, G: 'a + Symbol, H: 'a + Symbol, I: 'a + Symbol, J: 'a + Symbol, K: 'a + Symbol, L: 'a + Symbol, M: 'a + Symbol, N: 'a + Symbol> From<(A, B, C, D, E, F, G, H, I, J, K, L, M, N)> for List<'a> {
|
|
|
|
fn from((a, b, c, d, e, f, g, h, i, j, k, l, m, n): (A, B, C, D, E, F, G, H, I, J, K, L, M, N)) -> Self {
|
|
|
|
Self::new(vec![Box::new(a), Box::new(b), Box::new(c), Box::new(d), Box::new(e), Box::new(f), Box::new(g), Box::new(h), Box::new(i), Box::new(j), Box::new(k), Box::new(l), Box::new(m), Box::new(n)])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for_each_tuple!(from_tuple);
|
|
|
|
|
|
|
|
struct SymbolListAction<'a> {
|
|
|
|
runner: &'a dyn SymbolRunner,
|
|
|
|