use crate::ast::core::{AstDag, Language};
#[derive(Debug, Clone, Default)]
pub struct ParserConfig {
pub include_comments: bool,
pub include_docs: bool,
pub max_depth: Option<u32>,
pub calculate_complexity: bool,
}
#[derive(Debug, Clone)]
pub struct ParserCapabilities {
pub languages: Vec<Language>,
pub incremental: bool,
pub error_recovery: bool,
}
pub struct ParseResult {
pub ast: AstDag,
pub errors: Vec<String>,
pub warnings: Vec<String>,
}
pub struct UnifiedParser {
#[allow(dead_code)]
config: ParserConfig,
}
impl UnifiedParser {
#[must_use]
pub fn new() -> Self {
Self {
config: ParserConfig::default(),
}
}
#[must_use]
pub fn with_config(config: ParserConfig) -> Self {
Self { config }
}
#[must_use]
pub fn capabilities(&self) -> ParserCapabilities {
ParserCapabilities {
languages: vec![Language::Rust, Language::Python, Language::TypeScript],
incremental: false,
error_recovery: true,
}
}
}
impl Default for UnifiedParser {
fn default() -> Self {
Self::new()
}
}
#[cfg(test)]
mod property_tests {
use proptest::prelude::*;
proptest! {
#[test]
fn basic_property_stability(_input in ".*") {
prop_assert!(true);
}
#[test]
fn module_consistency_check(_x in 0u32..1000) {
prop_assert!(_x < 1001);
}
}
}