diff options
Diffstat (limited to 'src/xml')
| -rw-r--r-- | src/xml/composers.rs | 4 | ||||
| -rw-r--r-- | src/xml/mod.rs | 6 | ||||
| -rw-r--r-- | src/xml/parsers.rs | 4 | ||||
| -rw-r--r-- | src/xml/parsers_complete.rs | 11 |
4 files changed, 23 insertions, 2 deletions
diff --git a/src/xml/composers.rs b/src/xml/composers.rs index a47f007..160811f 100644 --- a/src/xml/composers.rs +++ b/src/xml/composers.rs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 cel <cel@bunny.garden> +// +// SPDX-License-Identifier: AGPL-3.0-or-later + use std::{ fmt::{self, Display, Formatter, Write}, io, diff --git a/src/xml/mod.rs b/src/xml/mod.rs index b0d9056..2bf960e 100644 --- a/src/xml/mod.rs +++ b/src/xml/mod.rs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 cel <cel@bunny.garden> +// +// SPDX-License-Identifier: AGPL-3.0-or-later + use std::{char, ops::Deref}; use parsers_complete::Parser; @@ -328,7 +332,7 @@ impl<'s> Deref for CharData<'s> { /// [15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->' #[derive(Clone, Debug, PartialEq, Eq)] #[repr(transparent)] -pub struct Comment<'s>(&'s str); +pub struct Comment<'s>(pub(crate) &'s str); impl<'s> Deref for Comment<'s> { type Target = &'s str; diff --git a/src/xml/parsers.rs b/src/xml/parsers.rs index 79d72b4..b98d68a 100644 --- a/src/xml/parsers.rs +++ b/src/xml/parsers.rs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 cel <cel@bunny.garden> +// +// SPDX-License-Identifier: AGPL-3.0-or-later + use nom::{ branch::alt, bytes::streaming::{is_a, is_not, tag, take, take_while}, diff --git a/src/xml/parsers_complete.rs b/src/xml/parsers_complete.rs index f18d0ff..ae97d9e 100644 --- a/src/xml/parsers_complete.rs +++ b/src/xml/parsers_complete.rs @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2025 cel <cel@bunny.garden> +// +// SPDX-License-Identifier: AGPL-3.0-or-later + use nom::{ branch::alt, bytes::complete::{is_a, is_not, tag, take, take_while}, @@ -40,7 +44,12 @@ pub trait Parser<'s> { return Err(crate::error::Error::ExtraData(rest.to_string())); } } - Result::Err(e) => return Err(crate::error::Error::ParseError(e.to_string())), + Result::Err(e) => { + return Err(crate::error::Error::ParseError( + input.to_string(), + e.to_string(), + )) + } } } } |
