conch_runtime_pshaw/spawn/
ast_impl.rs

1//! This module defines various `Spawn` implementations on AST types defined by
2//! the `conch-parser` crate.
3
4use crate::spawn::{GuardBodyPair, PatternBodyPair};
5use conch_parser::ast;
6
7mod and_or;
8mod command;
9mod compound;
10mod listable;
11mod pipeable;
12mod simple;
13mod top_level_impl;
14
15impl<T> From<ast::GuardBodyPair<T>> for GuardBodyPair<Vec<T>> {
16    fn from(guard_body_pair: ast::GuardBodyPair<T>) -> Self {
17        GuardBodyPair {
18            guard: guard_body_pair.guard,
19            body: guard_body_pair.body,
20        }
21    }
22}
23
24impl<W, C> From<ast::PatternBodyPair<W, C>> for PatternBodyPair<Vec<W>, Vec<C>> {
25    fn from(ast: ast::PatternBodyPair<W, C>) -> Self {
26        PatternBodyPair {
27            patterns: ast.patterns,
28            body: ast.body,
29        }
30    }
31}