impl Parseable trait

This commit is contained in:
John Turner
2025-10-28 09:44:32 +00:00
parent 92a8e46082
commit b54616a6dd
6 changed files with 367 additions and 272 deletions

View File

@@ -1,5 +1,8 @@
use gentoo_utils::depend;
use mon::{Parser, eof, input::InputIter, tag};
use gentoo_utils::{
Parseable,
depend::{self, Expr},
};
use mon::{Parser, eof, input::InputIter, tag, whitespace1};
use std::fs;
#[test]
@@ -14,7 +17,8 @@ fn parse_md5_cache() {
if line.starts_with("DEPEND=") {
eprintln!("{line}");
eprintln!();
depend::parsers::exprs()
Expr::parser()
.separated_list(whitespace1(), 0..)
.ignore()
.or(eof())
.preceded_by(tag("DEPEND="))