| 20 | } |
| 21 | |
| 22 | pub fn new_root() -> Module { |
| 23 | // Each module starts with a default namespace that contains a wildcard |
| 24 | // and the standard library. |
| 25 | Module { |
| 26 | names: HashMap::from([ |
| 27 | ( |
| 28 | NS_DEFAULT_DB.to_string(), |
| 29 | Decl::from(DeclKind::Module(Module::new_database())), |
| 30 | ), |
| 31 | (NS_STD.to_string(), Decl::from(DeclKind::default())), |
| 32 | ]), |
| 33 | shadowed: None, |
| 34 | redirects: vec![ |
| 35 | Ident::from_name(NS_THIS), |
| 36 | Ident::from_name(NS_THAT), |
| 37 | Ident::from_name(NS_PARAM), |
| 38 | Ident::from_name(NS_STD), |
| 39 | ], |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | pub fn new_database() -> Module { |
| 44 | let names = HashMap::from([ |