nushell/crates/nu-protocol/src/ast/call.rs

29 lines
544 B
Rust
Raw Normal View History

2021-09-02 20:21:37 +02:00
use super::Expression;
use crate::{DeclId, Span};
2021-09-02 10:25:22 +02:00
#[derive(Debug, Clone)]
pub struct Call {
/// identifier of the declaration to call
pub decl_id: DeclId,
pub head: Span,
pub positional: Vec<Expression>,
pub named: Vec<(String, Option<Expression>)>,
}
impl Default for Call {
fn default() -> Self {
Self::new()
}
}
impl Call {
pub fn new() -> Call {
Self {
decl_id: 0,
head: Span::unknown(),
positional: vec![],
named: vec![],
}
}
}