devalang_core/core/utils/
validation.rs

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