feat: implement CLI for XBRL parsing and validation

- Parse command with optional stats flag
- Validate command with SEC EDGAR profile support
- Benchmark command for performance testing
- Colored output for better UX
This commit is contained in:
Stefano Amorelli
2025-08-16 17:25:06 +03:00
parent fd5b3a968d
commit 46ecbd2635
20 changed files with 25911 additions and 0 deletions

27
benches/parser.rs Normal file
View File

@@ -0,0 +1,27 @@
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use crabrl::Parser;
fn parse_small_file(c: &mut Criterion) {
let parser = Parser::new();
let content = include_bytes!("../tests/fixtures/small.xml");
c.bench_function("parse_small", |b| {
b.iter(|| {
parser.parse_bytes(black_box(content))
});
});
}
fn parse_medium_file(c: &mut Criterion) {
let parser = Parser::new();
let content = include_bytes!("../tests/fixtures/medium.xml");
c.bench_function("parse_medium", |b| {
b.iter(|| {
parser.parse_bytes(black_box(content))
});
});
}
criterion_group!(benches, parse_small_file, parse_medium_file);
criterion_main!(benches);