microcad_lang/model/
creator.rs1use crate::{resolve::*, value::Tuple};
7
8#[derive(Debug, Clone)]
10pub struct Creator {
11 pub symbol: Symbol,
13 pub arguments: Tuple,
15}
16
17impl Creator {
18 pub fn new(symbol: Symbol, arguments: Tuple) -> Self {
20 Self { symbol, arguments }
21 }
22}
23
24impl Info for Creator {
25 fn info(&self) -> SymbolInfo {
26 self.symbol.info()
27 }
28}
29
30impl std::fmt::Display for Creator {
31 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
32 write!(
33 f,
34 "{symbol}{arguments}",
35 symbol = self.symbol.full_name(),
36 arguments = self.arguments
37 )
38 }
39}
40
41impl std::hash::Hash for Creator {
42 fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
43 self.symbol.full_name().hash(state);
44 self.arguments.hash(state);
45 }
46}