#[derive(Debug, Clone, PartialEq, Eq)]
pub struct YamlDiagnostic {
    pub code: &'static str,
    pub message: &'static str,
    pub byte_start: usize,
    pub byte_end: usize,
}

#[derive(Debug, Clone)]
pub struct YamlParseReport {
    pub tree: Option<crate::syntax::SyntaxNode>,
    pub diagnostics: Vec<YamlDiagnostic>,
}

pub mod diagnostic_codes {
    pub const LEX_ERROR: &str = "YAML_LEX_ERROR";
    pub const LEX_TRAILING_CONTENT_AFTER_DOCUMENT_START: &str =
        "YAML_LEX_TRAILING_CONTENT_AFTER_DOCUMENT_START";
    pub const LEX_TRAILING_CONTENT_AFTER_DOCUMENT_END: &str =
        "YAML_LEX_TRAILING_CONTENT_AFTER_DOCUMENT_END";
    pub const LEX_INVALID_DOUBLE_QUOTED_ESCAPE: &str = "YAML_LEX_INVALID_DOUBLE_QUOTED_ESCAPE";
    pub const LEX_WRONG_INDENTED_FLOW: &str = "YAML_LEX_WRONG_INDENTED_FLOW";
    pub const LEX_REQUIRED_SIMPLE_KEY_NOT_FOUND: &str = "YAML_LEX_REQUIRED_SIMPLE_KEY_NOT_FOUND";
    pub const LEX_BLOCK_ENTRY_NOT_ALLOWED: &str = "YAML_LEX_BLOCK_ENTRY_NOT_ALLOWED";
    pub const LEX_KEY_INDICATOR_NOT_ALLOWED: &str = "YAML_LEX_KEY_INDICATOR_NOT_ALLOWED";
    pub const LEX_VALUE_INDICATOR_NOT_ALLOWED: &str = "YAML_LEX_VALUE_INDICATOR_NOT_ALLOWED";
    pub const LEX_UNTERMINATED_QUOTED_SCALAR: &str = "YAML_LEX_UNTERMINATED_QUOTED_SCALAR";
    pub const LEX_COMMENT_NOT_PRECEDED_BY_SPACE: &str = "YAML_LEX_COMMENT_NOT_PRECEDED_BY_SPACE";

    pub const PARSE_EXPECTED_FLOW_SEQUENCE_START: &str = "YAML_PARSE_EXPECTED_FLOW_SEQUENCE_START";
    pub const PARSE_TRAILING_CONTENT_AFTER_FLOW_END: &str =
        "YAML_PARSE_TRAILING_CONTENT_AFTER_FLOW_END";
    pub const PARSE_INVALID_FLOW_SEQUENCE_COMMA: &str = "YAML_PARSE_INVALID_FLOW_SEQUENCE_COMMA";
    pub const PARSE_UNTERMINATED_FLOW_SEQUENCE: &str = "YAML_PARSE_UNTERMINATED_FLOW_SEQUENCE";
    pub const PARSE_EXPECTED_FLOW_MAP_START: &str = "YAML_PARSE_EXPECTED_FLOW_MAP_START";
    pub const PARSE_UNTERMINATED_FLOW_MAP: &str = "YAML_PARSE_UNTERMINATED_FLOW_MAP";
    pub const PARSE_UNEXPECTED_FLOW_CLOSER: &str = "YAML_PARSE_UNEXPECTED_FLOW_CLOSER";
    pub const PARSE_UNEXPECTED_INDENT: &str = "YAML_PARSE_UNEXPECTED_INDENT";
    pub const PARSE_UNEXPECTED_DEDENT: &str = "YAML_PARSE_UNEXPECTED_DEDENT";
    pub const PARSE_INVALID_KEY_TOKEN: &str = "YAML_PARSE_INVALID_KEY_TOKEN";
    pub const PARSE_MISSING_COLON: &str = "YAML_PARSE_MISSING_COLON";
    pub const PARSE_UNTERMINATED_BLOCK_MAP: &str = "YAML_PARSE_UNTERMINATED_BLOCK_MAP";
    pub const PARSE_DIRECTIVE_AFTER_CONTENT: &str = "YAML_PARSE_DIRECTIVE_AFTER_CONTENT";
    pub const PARSE_DIRECTIVE_WITHOUT_DOCUMENT_START: &str =
        "YAML_PARSE_DIRECTIVE_WITHOUT_DOCUMENT_START";
    pub const PARSE_DUPLICATE_YAML_DIRECTIVE: &str = "YAML_PARSE_DUPLICATE_YAML_DIRECTIVE";
    pub const PARSE_MALFORMED_YAML_DIRECTIVE: &str = "YAML_PARSE_MALFORMED_YAML_DIRECTIVE";
    pub const PARSE_INVALID_PLAIN_SCALAR_IN_FLOW: &str = "YAML_PARSE_INVALID_PLAIN_SCALAR_IN_FLOW";
    pub const PARSE_ANCHOR_DECORATES_ALIAS: &str = "YAML_PARSE_ANCHOR_DECORATES_ALIAS";
    pub const PARSE_INVALID_TAG_CHARACTER: &str = "YAML_PARSE_INVALID_TAG_CHARACTER";
    pub const PARSE_UNDEFINED_TAG_HANDLE: &str = "YAML_PARSE_UNDEFINED_TAG_HANDLE";
    pub const PARSE_MULTIPLE_ANCHORS_ON_NODE: &str = "YAML_PARSE_MULTIPLE_ANCHORS_ON_NODE";
    pub const PARSE_ANCHOR_BEFORE_BLOCK_INDICATOR: &str =
        "YAML_PARSE_ANCHOR_BEFORE_BLOCK_INDICATOR";
    pub const PARSE_ANCHOR_WITHOUT_TARGET: &str = "YAML_PARSE_ANCHOR_WITHOUT_TARGET";
    pub const PARSE_NODE_PROPERTY_UNDERINDENTED: &str = "YAML_PARSE_NODE_PROPERTY_UNDERINDENTED";
}
