function rulesToStyleFunction(rules) {
  const parsingContext = newParsingContext();
  const evaluator = buildRuleSet(rules, parsingContext);
  const evaluationContext = newEvaluationContext();
  return function (feature, resolution) {
    evaluationContext.properties = feature.getPropertiesInternal();
    evaluationContext.resolution = resolution;
    if (parsingContext.featureId) {
      const id = feature.getId();
      if (id !== undefined) {
        evaluationContext.featureId = id;
      } else {
        evaluationContext.featureId = null;
      }
    }
    if (parsingContext.geometryType) {
      evaluationContext.geometryType = computeGeometryType(
        feature.getGeometry(),
      );
    }
    return evaluator(evaluationContext);
  };
}
This function adapts a rule evaluator to the existing style function interface.
After we have deprecated the style function, we can use the compiled rules directly
and pass a more complete evaluation context (variables, zoom, time, etc.).

@param {Array<import('../../style/flat.js').Rule>} rules The rules.
@return {import('../../style/Style.js').StyleFunction} A style function.