/* This is a generated file! */
/* Generated by `utils/build_lexers.py` via `utils/rustify.py` */
/* This process can be run via tox: `tox -e generate-rs` */
#![cfg_attr(rustfmt, rustfmt_skip)]
use once_cell::sync::Lazy;
use sqlfluffrs_types::{LexMatcher, LexMatcherConfig};
use sqlfluffrs_types::{Token, RegexModeGroup};
use sqlfluffrs_types::token::CaseFold;
use sqlfluffrs_types::{BracketPairEntry, BracketPairSet};

pub static REDSHIFT_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
    "AES128".to_string(),
    "AES256".to_string(),
    "ALL".to_string(),
    "ALLOWOVERWRITE".to_string(),
    "ANALYSE".to_string(),
    "ANALYZE".to_string(),
    "AND".to_string(),
    "ANY".to_string(),
    "APPEND".to_string(),
    "ARRAY".to_string(),
    "AS".to_string(),
    "ASC".to_string(),
    "AUTHORIZATION".to_string(),
    "AZ64".to_string(),
    "BETWEEN".to_string(),
    "BINARY".to_string(),
    "BLANKSASNULL".to_string(),
    "BOTH".to_string(),
    "BYTEDICT".to_string(),
    "CASE".to_string(),
    "CAST".to_string(),
    "CHECK".to_string(),
    "COLLATE".to_string(),
    "COLUMN".to_string(),
    "COMPROWS".to_string(),
    "COMPUPDATE".to_string(),
    "CONSTRAINT".to_string(),
    "CREATE".to_string(),
    "CREDENTIALS".to_string(),
    "CROSS".to_string(),
    "CURRENT_DATE".to_string(),
    "CURRENT_TIME".to_string(),
    "CURRENT_TIMESTAMP".to_string(),
    "CURRENT_USER".to_string(),
    "CURRENT_USER_ID".to_string(),
    "DATETIME".to_string(),
    "DEFAULT".to_string(),
    "DEFERRABLE".to_string(),
    "DEFRAG".to_string(),
    "DELIMITERS".to_string(),
    "DELTA".to_string(),
    "DELTA32K".to_string(),
    "DESC".to_string(),
    "DISABLE".to_string(),
    "DISTINCT".to_string(),
    "DO".to_string(),
    "ELSE".to_string(),
    "EMPTYASNULL".to_string(),
    "ENABLE".to_string(),
    "ENCRYPT".to_string(),
    "ENCRYPTION".to_string(),
    "END".to_string(),
    "EXCEPT".to_string(),
    "EXPLICIT_IDS".to_string(),
    "FALSE".to_string(),
    "FILLRECORD".to_string(),
    "FOR".to_string(),
    "FOREIGN".to_string(),
    "FREEZE".to_string(),
    "FROM".to_string(),
    "FULL".to_string(),
    "GLOBALDICT256".to_string(),
    "GLOBALDICT64K".to_string(),
    "GRANT".to_string(),
    "GROUP".to_string(),
    "HAVING".to_string(),
    "IDENTITY".to_string(),
    "IGNORE".to_string(),
    "IGNOREBLANKLINES".to_string(),
    "IGNOREHEADER".to_string(),
    "ILIKE".to_string(),
    "IN".to_string(),
    "INITIALLY".to_string(),
    "INNER".to_string(),
    "INTERSECT".to_string(),
    "INTO".to_string(),
    "IS".to_string(),
    "ISNULL".to_string(),
    "JOIN".to_string(),
    "LEADING".to_string(),
    "LEFT".to_string(),
    "LIKE".to_string(),
    "LIMIT".to_string(),
    "LOCALTIME".to_string(),
    "LOCALTIMESTAMP".to_string(),
    "LUN".to_string(),
    "LUNS".to_string(),
    "LZO".to_string(),
    "MINUS".to_string(),
    "MOSTLY16".to_string(),
    "MOSTLY32".to_string(),
    "MOSTLY8".to_string(),
    "NATURAL".to_string(),
    "NEW".to_string(),
    "NOT".to_string(),
    "NOTNULL".to_string(),
    "NULL".to_string(),
    "NULLS".to_string(),
    "OFF".to_string(),
    "OFFSET".to_string(),
    "OID".to_string(),
    "OLD".to_string(),
    "ON".to_string(),
    "ONLY".to_string(),
    "OPEN".to_string(),
    "OR".to_string(),
    "ORDER".to_string(),
    "OUTER".to_string(),
    "OVERLAPS".to_string(),
    "PARALLEL".to_string(),
    "PARTITION".to_string(),
    "PERCENT".to_string(),
    "PERMISSIONS".to_string(),
    "PIVOT".to_string(),
    "PLACING".to_string(),
    "PRIMARY".to_string(),
    "RAW".to_string(),
    "READRATIO".to_string(),
    "RECOVER".to_string(),
    "REFERENCES".to_string(),
    "REJECTLOG".to_string(),
    "RESORT".to_string(),
    "RESPECT".to_string(),
    "RESTORE".to_string(),
    "RIGHT".to_string(),
    "RUNLENGTH".to_string(),
    "SELECT".to_string(),
    "SESSION_USER".to_string(),
    "SIMILAR".to_string(),
    "SNAPSHOT".to_string(),
    "SOME".to_string(),
    "SYSDATE".to_string(),
    "SYSTEM".to_string(),
    "TABLE".to_string(),
    "TAG".to_string(),
    "TDES".to_string(),
    "TEXT255".to_string(),
    "TEXT32K".to_string(),
    "THEN".to_string(),
    "TIMESTAMP".to_string(),
    "TO".to_string(),
    "TOP".to_string(),
    "TRAILING".to_string(),
    "TRUE".to_string(),
    "TRUNCATECOLUMNS".to_string(),
    "UNION".to_string(),
    "UNIQUE".to_string(),
    "UNNEST".to_string(),
    "UNPIVOT".to_string(),
    "USER".to_string(),
    "USING".to_string(),
    "VERBOSE".to_string(),
    "WHEN".to_string(),
    "WHERE".to_string(),
    "WITH".to_string(),
    "WITHIN".to_string(),
    "WITHOUT".to_string(),
]});

pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![

    LexMatcher::regex_lexer(
        "whitespace",
        r#"[^\S\r\n]+"#,Token::whitespace_token,
        None,
        |_| true,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "inline_comment",
        r#"(--)[^\n]*"#,Token::comment_token,
        None,
        |input| input.starts_with(['#','-','/']),
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: Some(vec![String::from("--")]),
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "block_comment",
        r#"/\*(?>[^*/]+|\*(?!\/)|/[^*])*(?>(?R)(?>[^*/]+|\*(?!\/)|/[^*])*)*\*/"#,Token::comment_token,
        Some(extract_nested_block_comment),
        |input| input.starts_with("/"),
        LexMatcherConfig {
        subdivider: Some(Box::new(
    LexMatcher::regex_subdivider(
        "newline",
        r#"\r\n|\n"#,Token::newline_token,
        None,
        |_| true,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ))),
        trim_post_subdivide: Some(Box::new(
    LexMatcher::regex_subdivider(
        "whitespace",
        r#"[^\S\r\n]+"#,Token::whitespace_token,
        None,
        |_| true,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ))),
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "single_quote",
        r#"'([^']|'')*'"#,Token::code_token,
        None,
        |input| match input.as_bytes() {
        [b'\'', ..] => true,                     // Single quote case
        [b'R' | b'r', b'\'', ..] => true,        // r' or R'
        [b'B' | b'b', b'\'', ..] => true,        // b' or B'
        [b'R' | b'r', b'B' | b'b', b'\'', ..] => true, // rb', RB', etc.
        [b'B' | b'b', b'R' | b'r', b'\'', ..] => true, // br', Br', etc.
        _ => false,
    },
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: Some((r#"'((?:[^']|'')*)'"#.to_string(), RegexModeGroup::Index(1))),
        escape_replacements: Some(std::sync::Arc::new(vec![(r#"''"#.to_string(), r#"'"#.to_string())])),
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "double_quote",
        r#""([^"]|"")*""#,Token::code_token,
        None,
        |input| match input.as_bytes() {
        [b'"', ..] => true,                     // Just a double quote
        [b'R' | b'r', b'"', ..] => true,        // r" or R"
        [b'B' | b'b', b'"', ..] => true,        // b" or B"
        [b'R' | b'r', b'B' | b'b', b'"', ..] => true, // rb", RB", etc.
        [b'B' | b'b', b'R' | b'r', b'"', ..] => true, // br", Br", etc.
        _ => false,
    },
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: Some((r#""((?:[^"]|"")*)""#.to_string(), RegexModeGroup::Index(1))),
        escape_replacements: Some(std::sync::Arc::new(vec![(r#""""#.to_string(), r#"""#.to_string())])),
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "back_quote",
        r#"`(?:[^`\\]|\\.)*`"#,Token::code_token,
        None,
        |_| true,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: Some((r#"`((?:[^`\\]|\\.)*)`"#.to_string(), RegexModeGroup::Index(1))),
        escape_replacements: Some(std::sync::Arc::new(vec![(r#"\\`"#.to_string(), r#"`"#.to_string())])),
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "dollar_quote",
        r#"\$(\w*)\$(.*?)\$\1\$"#,Token::code_token,
        None,
        |input| input.starts_with("$"),
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: Some((r#"\$(\w*)\$(.*?)\$\1\$"#.to_string(), RegexModeGroup::Index(2))),
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "numeric_literal",
        r#"(?>\d+(_\d+)*\.\d+(_\d+)*|\d+(_\d+)*\.(?![\.\w])|\.\d+(_\d+)*|\d+(_\d+)*)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,Token::literal_token,
        None,
        |input| input.starts_with(['x','X','.','0','1','2','3','4','5','6','7','8','9', '-', '+', '$', '¢', '£', '¤', '¥', '৲', '৳', '฿', '៛', '₠', '₡', '₢', '₣', '₤', '₥', '₦', '₧', '₨', '₩', '₪', '₫', '€', '₭', '₮', '₯', '₰', '₱', '﹩', '＄', '￠', '￡', '￥', '￦']),
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "obevo_annotation",
        r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,Token::comment_token,
        None,
        |_| true,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "glob_operator",
        "~~~",Token::comparison_operator_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "unicode_single_quote",
        r#"(?si)U&'([^']|'')*'(\s*UESCAPE\s*'[^0-9A-Fa-f'+\-\s)]')?"#,Token::code_token,
        None,
        |_| true,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "escaped_single_quote",
        r#"(?si)E(('')+?(?!')|'.*?((?<!\\)(?:\\\\)*(?<!')(?:'')*|(?<!\\)(?:\\\\)*\\(?<!')(?:'')*')'(?!'))"#,Token::code_token,
        None,
        |input| input.starts_with(['E', 'e']),
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "unicode_double_quote",
        r#"(?si)U&".+?"(\s*UESCAPE\s*\'[^0-9A-Fa-f\'+\-\s)]\')?"#,Token::code_token,
        None,
        |_| true,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "json_operator",
        r#"->>?|#>>?|@[>@?]|<@|\?[|&]?|#-"#,Token::symbol_token,
        None,
        |_| true,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "pg_trgm_operator",
        r#"<<<->|<->>>|<->>|<<->(?!>)|<<%|%>>|<%|%>"#,Token::symbol_token,
        None,
        |_| true,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "pgvector_operator",
        r#"<->|<#>|<=>|<\+>"#,Token::symbol_token,
        None,
        |_| true,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "postgis_operator",
        r#"\&\&\&|\&<\||<<\||@|\|\&>|\|>>|\~=|<\->|\|=\||<\#>|<<\->>|<<\#>>"#,Token::symbol_token,
        None,
        |_| true,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "at",
        "@",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "bit_string_literal",
        r#"[bBxX]'[0-9a-fA-F]*'"#,Token::code_token,
        None,
        |_| true,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "full_text_search_operator",
        "!!",Token::symbol_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "like_operator",
        r#"!?~~?\*?"#,Token::comparison_operator_token,
        None,
        |_| true,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "newline",
        r#"\r\n|\n"#,Token::newline_token,
        None,
        |_| true,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "casting_operator",
        "::",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "right_arrow",
        "=>",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "walrus_operator",
        ":=",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "equals",
        "=",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "greater_than",
        ">",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "less_than",
        "<",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "not",
        "!",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "dot",
        ".",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "comma",
        ",",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "plus",
        "+",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "minus",
        "-",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "divide",
        "/",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "percent",
        "%",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "question",
        "?",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "ampersand",
        "&",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "vertical_bar",
        "|",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "caret",
        "^",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "star",
        "*",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "start_bracket",
        "(",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "end_bracket",
        ")",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "start_square_bracket",
        "[",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "end_square_bracket",
        "]",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "start_curly_bracket",
        "{",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "end_curly_bracket",
        "}",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "colon",
        ":",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::string_lexer(
        "semicolon",
        ";",Token::code_token,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "meta_command",
        r#"\\(?!gset|gexec|crosstabview\b|copy\b|set\b)([^\\\r\n])+((\\\\)|(?=\n)|(?=\r\n))?"#,Token::comment_token,
        None,
        |input| input.starts_with(['\\']),
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "dollar_numeric_literal",
        r#"\$\d+"#,Token::literal_token,
        None,
        |_| true,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "postgres_copy_stdin_data_block",
        r#"(?i)COPY\b(?:[^;']|'(?:[^']|'')*')*?\bFROM\b\s+STDIN\b(?:[^;']|'(?:[^']|'')*')*?;[ \t]*\r?\n(?:[^\r\n]*\r?\n)*?\\\.[ \t]*(?=\r?\n|$)"#,Token::code_token,
        None,
        |_| true,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "psql_copy_command",
        r#"\\copy\b(\s*\((?:[^()]*|\((?:[^()]*|\([^()]*\))*\))*\)[^\r\n]*|[^\r\n]+)"#,Token::code_token,
        None,
        |_| true,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "psql_set_command",
        r#"\\set\b[^\r\n]*"#,Token::code_token,
        None,
        |_| true,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "meta_command_query_buffer",
        r#"\\([^\\\r\n])+((\\g(set|exec))|(?=\n)|(?=\r\n))?"#,Token::symbol_token,
        None,
        |input| input.starts_with(['\\']),
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),

    LexMatcher::regex_lexer(
        "word",
        r#"#?[0-9a-zA-Z_]+[0-9a-zA-Z_$]*"#,Token::word_token,
        None,
        |_| true,
        LexMatcherConfig {
        subdivider: None,
        trim_post_subdivide: None,
        trim_start: None,
        trim_chars: None,
        quoted_value: None,
        escape_replacements: None,
        casefold: CaseFold::None,
        kwarg_type: None,
    },
    ),
]});

pub static REDSHIFT_BRACKET_PAIRS: Lazy<BracketPairSet> = Lazy::new(|| { BracketPairSet(vec![
    BracketPairEntry { open: "{", close: "}", start_type: "start_curly_bracket", end_type: "end_curly_bracket", persists: false },
    BracketPairEntry { open: "(", close: ")", start_type: "start_bracket", end_type: "end_bracket", persists: true },
    BracketPairEntry { open: "[", close: "]", start_type: "start_square_bracket", end_type: "end_square_bracket", persists: false },
]) });


// Wrapper function that passes the dialect name to the shared implementation
fn extract_nested_block_comment(input: &str) -> Option<&str> {
    crate::extract_nested_block_comment(input, "redshift")
}
