import defaults_default from "../../../../../../lodash-es/defaults.js";
import forEach_default from "../../../../../../lodash-es/forEach.js";
import { defaultGrammarResolverErrorProvider, defaultGrammarValidatorErrorProvider } from "../../errors_public.js";
import { resolveGrammar } from "../resolver.js";
import { validateGrammar } from "../checks.js";
function resolveGrammar$1(a) {
	let o = defaults_default(a, { errMsgProvider: defaultGrammarResolverErrorProvider }), s = {};
	return forEach_default(a.rules, (e) => {
		s[e.name] = e;
	}), resolveGrammar(s, o.errMsgProvider);
}
function validateGrammar$1(i) {
	return i = defaults_default(i, { errMsgProvider: defaultGrammarValidatorErrorProvider }), validateGrammar(i.rules, i.tokenTypes, i.errMsgProvider, i.grammarName);
}
export { resolveGrammar$1 as resolveGrammar, validateGrammar$1 as validateGrammar };
