import { resolveGrammar as t } from "../resolver.js";
import { validateGrammar as l } from "../checks.js";
import { defaultGrammarResolverErrorProvider as d, defaultGrammarValidatorErrorProvider as v } from "../../errors_public.js";
import m from "../../../../../../../../lodash-es@4.17.21/node_modules/lodash-es/defaults.js";
import i from "../../../../../../../../lodash-es@4.17.21/node_modules/lodash-es/forEach.js";
function P(r) {
  const o = m(r, {
    errMsgProvider: d
  }), a = {};
  return i(r.rules, (e) => {
    a[e.name] = e;
  }), t(a, o.errMsgProvider);
}
function g(r) {
  return r = m(r, {
    errMsgProvider: v
  }), l(r.rules, r.tokenTypes, r.errMsgProvider, r.grammarName);
}
export {
  P as resolveGrammar,
  g as validateGrammar
};
