0
0
Fork 0
mirror of https://github.com/renovatebot/renovate.git synced 2025-01-12 22:29:06 +00:00
renovatebot_renovate/lib/modules/manager/bazel-module/parser/index.ts
Tobias Schlatter 22d356b9b1
feat(bazel-module): add support for oci.pull (#32453)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2024-12-05 16:26:35 +00:00

21 lines
617 B
TypeScript

import { lang, query as q } from 'good-enough-parser';
import { Ctx } from '../context';
import type { RecordFragment } from '../fragments';
import { mavenRules } from './maven';
import { moduleRules } from './module';
import { ociRules } from './oci';
const rule = q.alt<Ctx>(moduleRules, mavenRules, ociRules);
const query = q.tree<Ctx>({
type: 'root-tree',
maxDepth: 16,
search: rule,
});
const starlarkLang = lang.createLang('starlark');
export function parse(input: string): RecordFragment[] {
const parsedResult = starlarkLang.query(input, query, new Ctx());
return parsedResult?.results ?? [];
}