#![deny(missing_docs)]
#![allow(clippy::type_complexity)]
#![doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/README.md"))]
#![allow(deprecated)]
mod common;
mod lex;
mod lossless;
mod parse;
pub use lex::SyntaxKind;
pub use lossless::{
Deb822, Entry, Error, IndentPattern, Lang, Paragraph, ParseError, PositionedParseError,
};
pub use parse::Parse;
pub use rowan::{TextRange, TextSize};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Indentation {
FieldNameLength,
Spaces(u32),
}
impl Default for Indentation {
fn default() -> Self {
Indentation::Spaces(4)
}
}
#[cfg(feature = "deb822-fast")]
impl deb822_fast::convert::Deb822LikeParagraph for crate::lossless::Paragraph {
fn get(&self, key: &str) -> Option<String> {
crate::lossless::Paragraph::get(self, key).map(|v| v.to_string())
}
fn set(&mut self, key: &str, value: &str) {
crate::lossless::Paragraph::set(self, key, value);
}
fn remove(&mut self, key: &str) {
crate::lossless::Paragraph::remove(self, key);
}
}