public static CompiledScope CreateRootScope(string name, IDictionary <string, object?> parameters) { var scope = new CompiledScope(name, null); foreach (var key in parameters.Keys) { scope.DefineVariable(key, parameters[key]?.GetType() ?? typeof(object)); } return(scope); }
internal static CompiledScope CreateDerivedRootScope(string name, params CompiledScope?[] scopes) { var newScope = new CompiledScope(name, null); foreach (var scope in scopes) { if (scope == null) { continue; } foreach (var parameter in scope.Variables) { if (newScope.TryGetVariable(parameter.Name, out _) == false) { newScope.DefineVariable(parameter); } } } return(newScope); }