Add subcommands. Switch from-* and to-* to them (#1708)

This commit is contained in:
Jonathan Turner
2020-05-04 20:44:33 +12:00
committed by GitHub
parent 453087248a
commit a9968046ed
64 changed files with 278 additions and 152 deletions

View File

@ -33,10 +33,13 @@ pub struct InternalCommand {
impl InternalCommand {
pub fn new(name: String, name_span: Span, full_span: Span) -> InternalCommand {
InternalCommand {
name: name.clone(),
name,
name_span,
args: crate::hir::Call::new(
Box::new(SpannedExpression::new(Expression::string(name), name_span)),
Box::new(SpannedExpression::new(
Expression::Command(name_span),
name_span,
)),
full_span,
),
}