nushell/crates/nu-protocol/src/variable.rs

21 lines
412 B
Rust
Raw Normal View History

2023-07-13 21:02:05 +00:00
use crate::{Span, Type, Value};
2022-03-09 09:42:19 +00:00
#[derive(Clone, Debug)]
pub struct Variable {
pub declaration_span: Span,
pub ty: Type,
pub mutable: bool,
2023-07-13 21:02:05 +00:00
pub const_val: Option<Value>,
2022-03-09 09:42:19 +00:00
}
impl Variable {
pub fn new(declaration_span: Span, ty: Type, mutable: bool) -> Variable {
2022-03-09 09:42:19 +00:00
Self {
declaration_span,
ty,
mutable,
2023-07-13 21:02:05 +00:00
const_val: None,
2022-03-09 09:42:19 +00:00
}
}
}