luaur_analysis/functions/max_scope.rs
1use crate::functions::subsumes_scope::subsumes;
2use crate::records::scope::Scope;
3
4/// `inline Scope* max(Scope* left, Scope* right)` (Scope.h:126-132).
5/// Returns the inner (more-specific) of two scopes.
6pub fn max(left: *mut Scope, right: *mut Scope) -> *mut Scope {
7 if subsumes(left, right) {
8 right
9 } else {
10 left
11 }
12}