fn const_expr(&self, globals: &mut Globals, node: Node) -> Result<Value, RubyError> {
        let loc = node.loc();
        match node.kind {
            NodeKind::Bool(b) => Ok(Value::bool(b)),
            NodeKind::Integer(i) => Ok(Value::integer(i)),
            NodeKind::Bignum(n) => Ok(Value::bignum(n)),
            NodeKind::Float(f) => Ok(Value::float(f)),
            NodeKind::Nil => Ok(Value::nil()),
            NodeKind::Symbol(s) => Ok(Value::symbol(s)),
            NodeKind::String(s) => Ok(Value::string(s)),
            NodeKind::Hash(key_value, true) => self.const_hash(globals, key_value),
            NodeKind::Array(nodes, true) => self.const_array(globals, nodes),
            NodeKind::RegExp(nodes, true) => self.const_regexp(globals, nodes, loc),
            _ => unreachable!("const_expr(): not supported. {:?}", node.kind),
        }
    }
Evaluate constant expression and return the value.
ruruby/src/codegen.rs