devalang_core/core/utils/
validation.rs

1
2// NOTE: Deprecated functions, kept for reference
3
4// pub fn is_valid_entity(entity: &str, module: &Module, global_store: &GlobalStore) -> bool {
5//     let built_ins = ["kick", "snare", "hat", "clap"];
6
7//     if built_ins.contains(&entity) {
8//         return true;
9//     }
10
11//     if let Some(val) = module.variable_table.get(entity) {
12//         match val {
13//             Value::Sample(_) => true,
14//             _ => false,
15//         }
16//     } else {
17//         false
18//     }
19// }
20
21// pub fn is_valid_identifier(ident: &str, module: &Module) -> bool {
22//     let built_ins = ["auto"];
23
24//     if built_ins.contains(&ident) {
25//         return true;
26//     }
27
28//     if let Some(val) = module.variable_table.get(ident) {
29//         match val {
30//             Value::Identifier(_) => true,
31//             _ => false,
32//         }
33//     } else {
34//         false
35//     }
36// }