"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const resolver = require("./lib-src-parse-grammar-resolver.cjs");
const checks = require("./lib-src-parse-grammar-checks.cjs");
const errors_public = require("./lib-src-parse-errors_public.cjs");
const defaults = require("../lodash-es/defaults2.cjs");
const forEach = require("../lodash-es/forEach2.cjs");
function resolveGrammar(options) {
  const actualOptions = defaults.default(options, {
    errMsgProvider: errors_public.defaultGrammarResolverErrorProvider
  });
  const topRulesTable = {};
  forEach.default(options.rules, (rule) => {
    topRulesTable[rule.name] = rule;
  });
  return resolver.resolveGrammar(topRulesTable, actualOptions.errMsgProvider);
}
function validateGrammar(options) {
  options = defaults.default(options, {
    errMsgProvider: errors_public.defaultGrammarValidatorErrorProvider
  });
  return checks.validateGrammar(options.rules, options.tokenTypes, options.errMsgProvider, options.grammarName);
}
exports.resolveGrammar = resolveGrammar;
exports.validateGrammar = validateGrammar;
//# sourceMappingURL=lib-src-parse-grammar-gast-gast_resolver_public.cjs.map
