1
use uniplate::Biplate;
2

            
3
use crate::ast::{Expression, Factor};
4

            
5
/// True iff the entire AST is constants.
6
77640
pub fn is_all_constant(expression: &Expression) -> bool {
7
77970
    for factor in <Expression as Biplate<Factor>>::universe_bi(expression) {
8
77970
        match factor {
9
16665
            Factor::Literal(_) => {}
10
            Factor::Reference(_) => {
11
61305
                return false;
12
            }
13
        }
14
    }
15

            
16
16335
    true
17
77640
}