rename lawbuilder to builder to not have law twice in law::LawBuilder
All checks were successful
CI/CD Pipeline / test (push) Successful in 4m44s
All checks were successful
CI/CD Pipeline / test (push) Successful in 4m44s
This commit is contained in:
@@ -20,7 +20,7 @@ use std::iter::Peekable;
|
||||
use log::{debug, trace};
|
||||
use roxmltree::{Children, Node};
|
||||
|
||||
use crate::law::LawBuilder;
|
||||
use crate::law;
|
||||
use crate::paragraph::parser::absatz::Absatz;
|
||||
use crate::paragraph::parser::{AbsatzAbs, Content, Fzinhalt, Kzinhalt, Ueberschrift};
|
||||
|
||||
@@ -31,7 +31,7 @@ pub(crate) struct Abschnitt {
|
||||
}
|
||||
|
||||
impl Abschnitt {
|
||||
pub(crate) fn parse(n: Node, builder: &mut LawBuilder) -> Abschnitt {
|
||||
pub(crate) fn parse(n: Node, builder: &mut law::Builder) -> Abschnitt {
|
||||
assert!(n.tag_name().name() == "abschnitt");
|
||||
|
||||
let mut ret = Abschnitt::default();
|
||||
@@ -97,7 +97,7 @@ impl Abschnitt {
|
||||
// There are paragraph-specific meta-data at the top and bottom of each xml file. We parse
|
||||
// those. When we encounter the title "Text" the real content starts, we stop parsing meta
|
||||
// data.
|
||||
fn handle_metadata(&mut self, c: &mut Peekable<Children>, builder: &mut LawBuilder) {
|
||||
fn handle_metadata(&mut self, c: &mut Peekable<Children>, builder: &mut law::Builder) {
|
||||
while c.peek().is_some() {
|
||||
let key = Ueberschrift::parse(c.next().unwrap(), "titel").content;
|
||||
|
||||
@@ -146,7 +146,7 @@ impl Abschnitt {
|
||||
// we have optionally headers. Such as "Einleitung", "Von den bürgerlichen Gesetzen üerhaupt,"
|
||||
// etc. If we have headers which indicate that we are done and we want to stop parsing
|
||||
// ("anlage" + "Artikel" we indicate this wish by returning false.
|
||||
fn handle_headers(c: &mut Peekable<Children>, builder: &mut LawBuilder) -> bool {
|
||||
fn handle_headers(c: &mut Peekable<Children>, builder: &mut law::Builder) -> bool {
|
||||
while let Some(child) = c.peek() {
|
||||
// Schiffahrtsgesetz: stop @ anlagen (for now)
|
||||
if Ueberschrift::test(child, "anlage") {
|
||||
|
@@ -26,7 +26,7 @@ use log::trace;
|
||||
use roxmltree::{Children, Node};
|
||||
|
||||
use crate::{
|
||||
law::{Content, LawBuilder},
|
||||
law::{self, Content},
|
||||
misc::Error,
|
||||
paragraph::parser::absatz::Absatz,
|
||||
};
|
||||
@@ -57,7 +57,7 @@ impl<'a> Expect<'a> {
|
||||
pub(crate) struct Risdok {}
|
||||
|
||||
impl Risdok {
|
||||
pub(crate) fn parse(n: Node, builder: &mut LawBuilder) -> bool {
|
||||
pub(crate) fn parse(n: Node, builder: &mut law::Builder) -> bool {
|
||||
assert!(n.tag_name().name() == "risdok");
|
||||
|
||||
let mut c = n.children();
|
||||
@@ -74,7 +74,7 @@ impl Risdok {
|
||||
true
|
||||
}
|
||||
|
||||
pub(crate) fn from_str(xml: &str, builder: &mut LawBuilder) -> Result<bool, Error> {
|
||||
pub(crate) fn from_str(xml: &str, builder: &mut law::Builder) -> Result<bool, Error> {
|
||||
let doc = roxmltree::Document::parse(xml)?;
|
||||
trace!("{doc:?}");
|
||||
let root = doc.root();
|
||||
@@ -98,7 +98,7 @@ impl Metadaten {
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub(crate) struct Nutzdaten {}
|
||||
impl Nutzdaten {
|
||||
pub(crate) fn parse(n: Node, builder: &mut LawBuilder) -> bool {
|
||||
pub(crate) fn parse(n: Node, builder: &mut law::Builder) -> bool {
|
||||
assert!(n.tag_name().name() == "nutzdaten");
|
||||
|
||||
let mut c = n.children();
|
||||
|
Reference in New Issue
Block a user