//! # Parser Module
//!
//! Pipeline: `text → tokenizer → parser → AST → semantic analysis → execution`
//!
//! Parses `.gctf` test files into an AST with support for:
//! - JSON5 with comments, trailing commas, unquoted keys
//! - Multi-document files separated by `--- NEW ---`
//! - Error recovery parsing
//! - Ternary expressions in EXTRACT sections
//! - Full assertion AST with tokenization and span tracking

pub mod assertion_ast;
pub(crate) mod assertions;
pub mod ast;
pub mod content_parser;
pub mod core;
pub mod document_splitter;
pub mod error_recovery;
pub mod gctf_tokenizer;
pub mod json_mod;
pub mod json_stream_parser;
pub mod ternary;
pub mod ternary_ast;
pub mod tokenizer;
pub mod validator;

pub use assertion_ast::{
    AssertionExpr, BinaryOp, Expr, Literal, assertion_to_string, parse_assertion,
    remove_redundant_parens,
};
pub use content_parser::{build_section, parse_inline_options, parse_section_content};
pub use tokenizer::{
    Span, Token, TokenKind, collect_identifiers, collect_operators, collect_plugin_calls,
    tokenize_assertion,
};

pub use gctf_tokenizer::{
    GctfToken, GctfTokenKind, tokenize_extract_line, tokenize_gctf, tokenize_inline_options,
    tokenize_kv_line,
};

pub use document_splitter::split_sections_by_boundary;

pub use ast::{DocumentChainIter, GctfDocument};
pub use core::{ParseDiagnostics, parse_gctf, parse_gctf_from_str, parse_gctf_with_diagnostics};
pub use error_recovery::{ErrorRecoveryResult, parse_content_with_recovery, parse_with_recovery};
pub use ternary::{process_extract_value, ternary_to_jq};
pub use ternary_ast::{ExtractValue, ExtractVar};
pub use validator::{
    ErrorSeverity, ValidationError, validate_document, validate_document_diagnostics,
};
