mirror of
https://github.com/sqlfluff/sqlfluff
synced 2025-12-17 19:31:32 +00:00
refactor: Move Rust parts into their own crates (#7229)
This commit is contained in:
2403
sqlfluffrs/Cargo.lock
generated
2403
sqlfluffrs/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -9,14 +9,22 @@ edition = "2021"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
[lib]
|
||||
name = "sqlfluffrs"
|
||||
crate-type = ["cdylib"]
|
||||
crate-type = ["cdylib", "rlib"]
|
||||
|
||||
[workspace]
|
||||
members = [
|
||||
"sqlfluffrs_dialects",
|
||||
"sqlfluffrs_lexer",
|
||||
"sqlfluffrs_types",
|
||||
]
|
||||
|
||||
[features]
|
||||
unicode = []
|
||||
python = ["unicode", "pyo3"]
|
||||
python = ["unicode", "pyo3", "sqlfluffrs_lexer/python", "sqlfluffrs_types/python"]
|
||||
|
||||
[dependencies]
|
||||
env_logger = "0.11.8"
|
||||
regex = { version = "1.11.2", features = ["perf"] }
|
||||
fancy-regex = "0.16.2"
|
||||
hashbrown = "0.15.5"
|
||||
itertools = "0.14.0"
|
||||
@@ -24,12 +32,19 @@ log = "0.4.28"
|
||||
once_cell = "1.21.3"
|
||||
pyo3 = { version = "0.26.0", optional = true, features = ["hashbrown", "extension-module", "uuid"] }
|
||||
pyo3-log = { version = "0.13.0", optional = true }
|
||||
regex = { version = "1.11.2", features = ["perf"] }
|
||||
slotmap = "1.0.7"
|
||||
uuid = { version = "1.18.1", features = ["v4"] }
|
||||
serde = { version = "1.0.225", features = ["derive"] }
|
||||
serde_json = "1.0.145"
|
||||
# serde_yaml = "0.9"
|
||||
serde_yaml_ng = "0.10.0"
|
||||
bincode = "1.3.3"
|
||||
blake2 = "0.10.6"
|
||||
sqlfluffrs_types = { path = "sqlfluffrs_types" }
|
||||
sqlfluffrs_lexer = { path = "sqlfluffrs_lexer" }
|
||||
sqlfluffrs_dialects = { path = "sqlfluffrs_dialects" }
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = "0.11.6"
|
||||
criterion = "0.7.0"
|
||||
flamegraph = "0.6.8"
|
||||
|
||||
10
sqlfluffrs/sqlfluffrs_dialects/Cargo.toml
Normal file
10
sqlfluffrs/sqlfluffrs_dialects/Cargo.toml
Normal file
@@ -0,0 +1,10 @@
|
||||
[package]
|
||||
name = "sqlfluffrs_dialects"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
hashbrown = "0.15.5"
|
||||
once_cell = "1.21.3"
|
||||
regex = { version = "1.11.2", features = ["perf"] }
|
||||
fancy-regex = "0.16.2"
|
||||
sqlfluffrs_types = { path = "../sqlfluffrs_types" }
|
||||
89
sqlfluffrs/sqlfluffrs_dialects/src/block_comment.rs
Normal file
89
sqlfluffrs/sqlfluffrs_dialects/src/block_comment.rs
Normal file
@@ -0,0 +1,89 @@
|
||||
/// Extract nested block comments from SQL input.
|
||||
///
|
||||
/// This function handles nested block comments (/* ... /* ... */ ... */)
|
||||
/// for SQL dialects that support them.
|
||||
///
|
||||
/// # Arguments
|
||||
/// * `input` - The input string starting with "/*"
|
||||
/// * `dialect` - The SQL dialect name (used for dialect-specific behavior)
|
||||
///
|
||||
/// # Returns
|
||||
/// * `Some(&str)` - The complete block comment if valid (borrowed from `input`)
|
||||
/// * `None` - If the comment is invalid or improperly closed
|
||||
pub fn extract_nested_block_comment<'a>(input: &'a str, dialect: &str) -> Option<&'a str> {
|
||||
let mut chars = input.chars().peekable();
|
||||
let mut comment = String::new();
|
||||
|
||||
// Ensure the input starts with "/*"
|
||||
if chars.next() != Some('/') || chars.next() != Some('*') {
|
||||
return None;
|
||||
}
|
||||
|
||||
comment.push_str("/*"); // Add the opening delimiter
|
||||
let mut depth = 1; // Track nesting level
|
||||
|
||||
while let Some(c) = chars.next() {
|
||||
comment.push(c);
|
||||
|
||||
if c == '/' && chars.peek() == Some(&'*') {
|
||||
chars.next(); // Consume '*'
|
||||
comment.push('*');
|
||||
depth += 1;
|
||||
} else if c == '*' && chars.peek() == Some(&'/') {
|
||||
chars.next(); // Consume '/'
|
||||
comment.push('/');
|
||||
depth -= 1;
|
||||
|
||||
if depth == 0 {
|
||||
return Some(&input[..comment.len()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we reach here, the comment wasn't properly closed
|
||||
// SQLite allows unclosed comments, other dialects don't
|
||||
match dialect {
|
||||
"sqlite" => Some(&input[..comment.len()]),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_simple_block_comment() {
|
||||
let input = "/* simple comment */";
|
||||
let result = extract_nested_block_comment(input, "ansi");
|
||||
assert_eq!(result, Some("/* simple comment */"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_nested_block_comment() {
|
||||
let input = "/* outer /* inner */ still outer */";
|
||||
let result = extract_nested_block_comment(input, "ansi");
|
||||
assert_eq!(result, Some("/* outer /* inner */ still outer */"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_unclosed_comment_sqlite() {
|
||||
let input = "/* unclosed comment";
|
||||
let result = extract_nested_block_comment(input, "sqlite");
|
||||
assert_eq!(result, Some("/* unclosed comment"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_unclosed_comment_other_dialect() {
|
||||
let input = "/* unclosed comment";
|
||||
let result = extract_nested_block_comment(input, "postgres");
|
||||
assert_eq!(result, None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_invalid_start() {
|
||||
let input = "not a comment";
|
||||
let result = extract_nested_block_comment(input, "ansi");
|
||||
assert_eq!(result, None);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static ANSI_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"CASE".to_string(),
|
||||
@@ -35,7 +31,6 @@ pub static ANSI_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Ansi,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -58,7 +53,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Ansi,
|
||||
"inline_comment",
|
||||
r#"(--|#)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -81,7 +75,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Ansi,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -93,7 +86,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Ansi,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -116,7 +108,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Ansi,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -148,7 +139,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Ansi,
|
||||
"single_quote",
|
||||
r#"'([^'\\]|\\.|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -178,7 +168,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Ansi,
|
||||
"double_quote",
|
||||
r#""(""|[^"\\]|\\.)*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -208,7 +197,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Ansi,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -231,7 +219,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Ansi,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -254,7 +241,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Ansi,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -277,7 +263,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Ansi,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -300,7 +285,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -321,7 +305,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Ansi,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -344,7 +327,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Ansi,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -367,7 +349,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -388,7 +369,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -409,7 +389,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -430,7 +409,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -451,7 +429,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -472,7 +449,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -493,7 +469,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -514,7 +489,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -535,7 +509,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -556,7 +529,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -577,7 +549,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -598,7 +569,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -619,7 +589,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -640,7 +609,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -661,7 +629,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -682,7 +649,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -703,7 +669,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -724,7 +689,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -745,7 +709,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -766,7 +729,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -787,7 +749,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -808,7 +769,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -829,7 +789,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -850,7 +809,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Ansi,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -871,7 +829,6 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Ansi,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -893,3 +850,9 @@ pub static ANSI_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "ansi")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static ATHENA_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ALL".to_string(),
|
||||
@@ -147,7 +143,6 @@ pub static ATHENA_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Athena,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -170,7 +165,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Athena,
|
||||
"inline_comment",
|
||||
r#"(--|#)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -193,7 +187,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Athena,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -205,7 +198,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Athena,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -228,7 +220,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Athena,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -260,7 +251,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Athena,
|
||||
"single_quote",
|
||||
r#"'([^'\\]|\\.|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -290,7 +280,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Athena,
|
||||
"double_quote",
|
||||
r#""(""|[^"\\]|\\.)*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -320,7 +309,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Athena,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -343,7 +331,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Athena,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -366,7 +353,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Athena,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -389,7 +375,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Athena,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -412,7 +397,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -433,7 +417,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"right_arrow",
|
||||
"->",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -454,7 +437,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Athena,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -477,7 +459,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Athena,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -500,7 +481,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -521,7 +501,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -542,7 +521,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -563,7 +541,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -584,7 +561,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -605,7 +581,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -626,7 +601,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -647,7 +621,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -668,7 +641,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -689,7 +661,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -710,7 +681,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -731,7 +701,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -752,7 +721,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -773,7 +741,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -794,7 +761,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -815,7 +781,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -836,7 +801,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -857,7 +821,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -878,7 +841,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -899,7 +861,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -920,7 +881,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -941,7 +901,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -962,7 +921,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -983,7 +941,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Athena,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1004,7 +961,6 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Athena,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1026,3 +982,9 @@ pub static ATHENA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "athena")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static BIGQUERY_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"AGGREGATE".to_string(),
|
||||
@@ -114,7 +110,6 @@ pub static BIGQUERY_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Bigquery,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -137,7 +132,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Bigquery,
|
||||
"inline_comment",
|
||||
r#"(--|#)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -160,7 +154,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Bigquery,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -172,7 +165,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Bigquery,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -195,7 +187,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Bigquery,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -227,7 +218,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Bigquery,
|
||||
"single_quote",
|
||||
r#"([rR]?[bB]?|[bB]?[rR]?)?('''((?<!\\)(\\{2})*\\'|'{,2}(?!')|[^'])*(?<!\\)(\\{2})*'''|'((?<!\\)(\\{2})*\\'|[^'])*(?<!\\)(\\{2})*')"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -257,7 +247,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Bigquery,
|
||||
"double_quote",
|
||||
r#"([rR]?[bB]?|[bB]?[rR]?)?(\"\"\"((?<!\\)(\\{2})*\\\"|\"{,2}(?!\")|[^\"])*(?<!\\)(\\{2})*\"\"\"|"((?<!\\)(\\{2})*\\"|[^"])*(?<!\\)(\\{2})*")"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -287,7 +276,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Bigquery,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -310,7 +298,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Bigquery,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -333,7 +320,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Bigquery,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -356,7 +342,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Bigquery,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -379,7 +364,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -400,7 +384,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Bigquery,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -423,7 +406,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Bigquery,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -446,7 +428,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -467,7 +448,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"right_arrow",
|
||||
"=>",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -488,7 +468,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"question_mark",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -509,7 +488,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Bigquery,
|
||||
"at_sign_literal",
|
||||
r#"@[a-zA-Z_][\w]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -532,7 +510,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Bigquery,
|
||||
"double_at_sign_literal",
|
||||
r#"@@[a-zA-Z_][\w\.]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -555,7 +532,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"pipe_operator",
|
||||
"|>",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -576,7 +552,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -597,7 +572,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -618,7 +592,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -639,7 +612,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -660,7 +632,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -681,7 +652,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -702,7 +672,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -723,7 +692,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -744,7 +712,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -765,7 +732,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -786,7 +752,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -807,7 +772,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -828,7 +792,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -849,7 +812,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -870,7 +832,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -891,7 +852,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -912,7 +872,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -933,7 +892,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -954,7 +912,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -975,7 +932,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -996,7 +952,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1017,7 +972,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1038,7 +992,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Bigquery,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1059,7 +1012,6 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Bigquery,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1081,3 +1033,9 @@ pub static BIGQUERY_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "bigquery")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static CLICKHOUSE_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"CASE".to_string(),
|
||||
@@ -35,7 +31,6 @@ pub static CLICKHOUSE_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -58,7 +53,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"inline_comment",
|
||||
r#"(--|#)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -81,7 +75,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -93,7 +86,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Clickhouse,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -116,7 +108,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Clickhouse,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -148,7 +139,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"single_quote",
|
||||
r#"'([^'\\]|\\.|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -178,7 +168,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"double_quote",
|
||||
r#""([^"\\]|""|\\.)*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -208,7 +197,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|``|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -231,7 +219,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -254,7 +241,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -277,7 +263,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -300,7 +285,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -321,7 +305,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -344,7 +327,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"lambda",
|
||||
"->",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -365,7 +347,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -388,7 +369,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -409,7 +389,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -430,7 +409,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -451,7 +429,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -472,7 +449,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -493,7 +469,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -514,7 +489,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -535,7 +509,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -556,7 +529,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -577,7 +549,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -598,7 +569,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -619,7 +589,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -640,7 +609,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -661,7 +629,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -682,7 +649,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -703,7 +669,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -724,7 +689,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -745,7 +709,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -766,7 +729,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -787,7 +749,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -808,7 +769,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -829,7 +789,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -850,7 +809,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -871,7 +829,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -892,7 +849,6 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Clickhouse,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -914,3 +870,9 @@ pub static CLICKHOUSE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "clickhouse")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static DATABRICKS_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ANTI".to_string(),
|
||||
@@ -29,7 +25,6 @@ pub static DATABRICKS_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -52,7 +47,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"notebook_start",
|
||||
r#"-- Databricks notebook source(\r?\n){1}"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -75,7 +69,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"magic_single_line",
|
||||
r#"(-- MAGIC %)([^\n]{2,})( [^%]{1})([^\n]*)"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -98,7 +91,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"magic_line",
|
||||
r#"(-- MAGIC)( [^%]{1})([^\n]*)"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -121,7 +113,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"magic_start",
|
||||
r#"(-- MAGIC %)([^\n]{2,})(\r?\n)"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -144,7 +135,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"inline_comment",
|
||||
r#"(--)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -167,7 +157,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"start_hint",
|
||||
"/*+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -188,7 +177,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -200,7 +188,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Databricks,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -223,7 +210,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Databricks,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -255,7 +241,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"raw_single_quote",
|
||||
r#"[rR]'([^'\\]|\\.)*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -278,7 +263,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"raw_double_quote",
|
||||
r#"[rR]"([^"\\]|\\.)*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -301,7 +285,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"bytes_single_quote",
|
||||
r#"X'([^'\\]|\\.)*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -324,7 +307,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"bytes_double_quote",
|
||||
r#"X"([^"\\]|\\.)*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -347,7 +329,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"end_hint",
|
||||
"*/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -368,7 +349,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"single_quote",
|
||||
r#"'([^'\\]|\\.|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -398,7 +378,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"double_quote",
|
||||
r#""(""|[^"\\]|\\.)*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -428,7 +407,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"back_quote",
|
||||
r#"`([^`]|``)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -451,7 +429,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -474,7 +451,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"numeric_literal",
|
||||
r#"(?>(?>\d+\.\d+|\d+\.|\.\d+)([eE][+-]?\d+)?([dDfF]|BD|bd)?|\d+[eE][+-]?\d+([dDfF]|BD|bd)?|\d+([dDfFlLsSyY]|BD|bd)?)((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -497,7 +473,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -520,7 +495,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -541,7 +515,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"right_arrow",
|
||||
"->",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -562,7 +535,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -585,7 +557,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"file_literal",
|
||||
r#"[a-zA-Z0-9]+:([a-zA-Z0-9\-_\.]*(\/|\\)){2,}((([a-zA-Z0-9\-_\.]*(:|\?|=|&)[a-zA-Z0-9\-_\.]*)+)|([a-zA-Z0-9\-_\.]*\.[a-z]+))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -608,7 +579,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"command",
|
||||
r#"(\r?\n){2}-- COMMAND ----------(\r?\n)"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -631,7 +601,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -654,7 +623,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -675,7 +643,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"right_arrow",
|
||||
"=>",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -696,7 +663,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"equals",
|
||||
r#"==|<=>|="#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -719,7 +685,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -740,7 +705,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -761,7 +725,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -782,7 +745,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -803,7 +765,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -824,7 +785,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -845,7 +805,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -866,7 +825,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -887,7 +845,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -908,7 +865,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -929,7 +885,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -950,7 +905,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -971,7 +925,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -992,7 +945,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1013,7 +965,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1034,7 +985,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1055,7 +1005,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1076,7 +1025,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1097,7 +1045,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1118,7 +1065,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1139,7 +1085,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1160,7 +1105,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Databricks,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1181,7 +1125,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"at_sign_literal",
|
||||
r#"@\w*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1204,7 +1147,6 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Databricks,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1226,3 +1168,9 @@ pub static DATABRICKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "databricks")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static DB2_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"CASE".to_string(),
|
||||
@@ -34,7 +30,6 @@ pub static DB2_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Db2,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -57,7 +52,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Db2,
|
||||
"inline_comment",
|
||||
r#"(--)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -80,7 +74,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Db2,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -92,7 +85,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Db2,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -115,7 +107,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Db2,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -147,7 +138,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Db2,
|
||||
"single_quote",
|
||||
r#"'((?:[^']|'')*)'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -177,7 +167,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Db2,
|
||||
"double_quote",
|
||||
r#""((?:[^"]|"")*)""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -207,7 +196,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Db2,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -230,7 +218,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Db2,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -253,7 +240,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Db2,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -276,7 +262,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Db2,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -299,7 +284,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -320,7 +304,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Db2,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -343,7 +326,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Db2,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -366,7 +348,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -387,7 +368,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"right_arrow",
|
||||
"=>",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -408,7 +388,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -429,7 +408,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -450,7 +428,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -471,7 +448,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -492,7 +468,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -513,7 +488,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -534,7 +508,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -555,7 +528,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -576,7 +548,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -597,7 +568,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -618,7 +588,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -639,7 +608,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -660,7 +628,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -681,7 +648,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -702,7 +668,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -723,7 +688,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -744,7 +708,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -765,7 +728,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -786,7 +748,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -807,7 +768,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -828,7 +788,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -849,7 +808,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -870,7 +828,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Db2,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -891,7 +848,6 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Db2,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_#]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -913,3 +869,9 @@ pub static DB2_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "db2")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static DORIS_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ACCOUNT_LOCK".to_string(),
|
||||
@@ -195,7 +191,6 @@ pub static DORIS_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Doris,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -218,7 +213,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Doris,
|
||||
"inline_comment",
|
||||
r#"(^--|-- |#)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -241,7 +235,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Doris,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -253,7 +246,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Doris,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -276,7 +268,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Doris,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -308,7 +299,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Doris,
|
||||
"single_quote",
|
||||
r#"(?s)('(?:\\'|''|\\\\|[^'])*'(?!'))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -338,7 +328,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Doris,
|
||||
"double_quote",
|
||||
r#"(?s)("(?:\\"|""|\\\\|[^"])*"(?!"))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -368,7 +357,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Doris,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -391,7 +379,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Doris,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -414,7 +401,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Doris,
|
||||
"hexadecimal_literal",
|
||||
r#"([xX]'([\da-fA-F][\da-fA-F])+'|0x[\da-fA-F]+)"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -437,7 +423,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Doris,
|
||||
"bit_value_literal",
|
||||
r#"([bB]'[01]+'|0b[01]+)"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -460,7 +445,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Doris,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -483,7 +467,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Doris,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -506,7 +489,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -527,7 +509,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Doris,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -550,7 +531,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Doris,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -573,7 +553,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -594,7 +573,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"walrus_operator",
|
||||
":=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -615,7 +593,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -636,7 +613,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"inline_path_operator",
|
||||
"->>",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -657,7 +633,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"column_path_operator",
|
||||
"->",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -678,7 +653,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -699,7 +673,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -720,7 +693,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -741,7 +713,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -762,7 +733,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -783,7 +753,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -804,7 +773,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -825,7 +793,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -846,7 +813,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -867,7 +833,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -888,7 +853,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"double_ampersand",
|
||||
"&&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -909,7 +873,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -930,7 +893,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"double_vertical_bar",
|
||||
"||",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -951,7 +913,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -972,7 +933,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -993,7 +953,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1014,7 +973,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1035,7 +993,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1056,7 +1013,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1077,7 +1033,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1098,7 +1053,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1119,7 +1073,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1140,7 +1093,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1161,7 +1113,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Doris,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1182,7 +1133,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Doris,
|
||||
"at_sign",
|
||||
r#"@@?[a-zA-Z0-9_$]*(\.[a-zA-Z0-9_$]+)?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1205,7 +1155,6 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Doris,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1227,3 +1176,9 @@ pub static DORIS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "doris")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static DUCKDB_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ALL".to_string(),
|
||||
@@ -119,7 +115,6 @@ pub static DUCKDB_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -142,7 +137,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"inline_comment",
|
||||
r#"(--)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -165,7 +159,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"block_comment",
|
||||
r#"/\*(?>[^*/]+|\*(?!\/)|/[^*])*(?>(?R)(?>[^*/]+|\*(?!\/)|/[^*])*)*\*/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -177,7 +170,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Duckdb,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -200,7 +192,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Duckdb,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -232,7 +223,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"single_quote",
|
||||
r#"'([^']|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -262,7 +252,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"double_quote",
|
||||
r#""([^"]|"")*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -292,7 +281,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -315,7 +303,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -338,7 +325,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -361,7 +347,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -384,7 +369,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -405,7 +389,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"unicode_single_quote",
|
||||
r#"(?si)U&'([^']|'')*'(\s*UESCAPE\s*'[^0-9A-Fa-f'+\-\s)]')?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -428,7 +411,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"escaped_single_quote",
|
||||
r#"(?si)E(('')+?(?!')|'.*?((?<!\\)(?:\\\\)*(?<!')(?:'')*|(?<!\\)(?:\\\\)*\\(?<!')(?:'')*')'(?!'))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -451,7 +433,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"unicode_double_quote",
|
||||
r#"(?si)U&".+?"(\s*UESCAPE\s*\'[^0-9A-Fa-f\'+\-\s)]\')?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -474,7 +455,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"json_operator",
|
||||
r#"->>?|#>>?|@[>@?]|<@|\?[|&]?|#-"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -497,7 +477,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"pg_trgm_operator",
|
||||
r#"<<<->|<->>>|<->>|<<->(?!>)|<<%|%>>|<%|%>"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -520,7 +499,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"pgvector_operator",
|
||||
r#"<->|<#>|<=>|<\+>"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -543,7 +521,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"postgis_operator",
|
||||
r#"\&\&\&|\&<\||<<\||@|\|\&>|\|>>|\~=|<\->|\|=\||<\#>|<<\->>|<<\#>>"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -566,7 +543,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"at",
|
||||
"@",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -587,7 +563,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"bit_string_literal",
|
||||
r#"[bBxX]'[0-9a-fA-F]*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -610,7 +585,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"full_text_search_operator",
|
||||
"!!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -631,7 +605,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -654,7 +627,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -677,7 +649,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -698,7 +669,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"right_arrow",
|
||||
"=>",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -719,7 +689,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"walrus_operator",
|
||||
":=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -740,7 +709,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"equals",
|
||||
r#"==?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -763,7 +731,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -784,7 +751,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -805,7 +771,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -826,7 +791,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -847,7 +811,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -868,7 +831,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -889,7 +851,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -910,7 +871,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"double_divide",
|
||||
"//",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -931,7 +891,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -952,7 +911,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -973,7 +931,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -994,7 +951,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1015,7 +971,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1036,7 +991,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1057,7 +1011,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1078,7 +1031,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1099,7 +1051,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1120,7 +1071,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1141,7 +1091,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1162,7 +1111,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1183,7 +1131,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1204,7 +1151,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1225,7 +1171,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Duckdb,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1246,7 +1191,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"meta_command",
|
||||
r#"\\(?!gset|gexec)([^\\\r\n])+((\\\\)|(?=\n)|(?=\r\n))?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1269,7 +1213,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"dollar_numeric_literal",
|
||||
r#"\$\d+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1292,7 +1235,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"meta_command_query_buffer",
|
||||
r#"\\([^\\\r\n])+((\\g(set|exec))|(?=\n)|(?=\r\n))?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1315,7 +1257,6 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Duckdb,
|
||||
"word",
|
||||
r#"[\p{L}_][\p{L}\p{N}_$]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1337,3 +1278,9 @@ pub static DUCKDB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "duckdb")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static EXASOL_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ABSOLUTE".to_string(),
|
||||
@@ -480,7 +476,6 @@ pub static EXASOL_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Exasol,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -503,7 +498,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Exasol,
|
||||
"inline_comment",
|
||||
r#"--[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -526,7 +520,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Exasol,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -538,7 +531,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Exasol,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -561,7 +553,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Exasol,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -593,7 +584,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Exasol,
|
||||
"single_quote",
|
||||
r#"'([^']|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -623,7 +613,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Exasol,
|
||||
"double_quote",
|
||||
r#""([^"]|"")*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -653,7 +642,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Exasol,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -676,7 +664,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Exasol,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -699,7 +686,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Exasol,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -722,7 +708,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Exasol,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -745,7 +730,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -766,7 +750,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Exasol,
|
||||
"lua_nested_quotes",
|
||||
r#"\[={1,3}\[.*\]={1,3}\]"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -789,7 +772,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Exasol,
|
||||
"lua_multiline_quotes",
|
||||
r#"\[{2}([^\[\\]|\\.)*\]{2}"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -812,7 +794,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Exasol,
|
||||
"escaped_identifier",
|
||||
r#"\[\w+\]"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -835,7 +816,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Exasol,
|
||||
"udf_param_dot_syntax",
|
||||
r#"\.{3}"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -858,7 +838,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Exasol,
|
||||
"range_operator",
|
||||
r#"\.{2}"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -881,7 +860,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"hash",
|
||||
"#",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -902,7 +880,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"walrus_operator",
|
||||
":=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -923,7 +900,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Exasol,
|
||||
"function_script_terminator",
|
||||
r#"\n/\n|\n/$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -935,7 +911,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Exasol,
|
||||
"newline",
|
||||
r#"(\n|\r\n)+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -968,7 +943,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Exasol,
|
||||
"at_sign_literal",
|
||||
r#"@[a-zA-Z_][\w]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -991,7 +965,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Exasol,
|
||||
"dollar_literal",
|
||||
r#"[$][a-zA-Z0-9_.]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1014,7 +987,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Exasol,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1037,7 +1009,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Exasol,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1060,7 +1031,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1081,7 +1051,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1102,7 +1071,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1123,7 +1091,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1144,7 +1111,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1165,7 +1131,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1186,7 +1151,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1207,7 +1171,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1228,7 +1191,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1249,7 +1211,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1270,7 +1231,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1291,7 +1251,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1312,7 +1271,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1333,7 +1291,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1354,7 +1311,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1375,7 +1331,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1396,7 +1351,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1417,7 +1371,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1438,7 +1391,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1459,7 +1411,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1480,7 +1431,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1501,7 +1451,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1522,7 +1471,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1543,7 +1491,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Exasol,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1564,7 +1511,6 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Exasol,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1586,3 +1532,9 @@ pub static EXASOL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "exasol")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static FLINK_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ALL".to_string(),
|
||||
@@ -134,7 +130,6 @@ pub static FLINK_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Flink,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -157,7 +152,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Flink,
|
||||
"inline_comment",
|
||||
r#"(--)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -180,7 +174,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Flink,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -192,7 +185,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Flink,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -215,7 +207,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Flink,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -247,7 +238,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Flink,
|
||||
"single_quote",
|
||||
r#"'([^'\\]|\\.)*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -277,7 +267,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Flink,
|
||||
"double_quote",
|
||||
r#""(""|[^"\\]|\\.)*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -307,7 +296,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Flink,
|
||||
"back_quote",
|
||||
r#"`([^`]|``)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -330,7 +318,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Flink,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -353,7 +340,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Flink,
|
||||
"numeric_literal",
|
||||
r#"(?>(?>\d+\.\d+|\d+\.|\.\d+)([eE][+-]?\d+)?([dDfF]|BD|bd)?|\d+[eE][+-]?\d+([dDfF]|BD|bd)?|\d+([dDfFlLsSyY]|BD|bd)?)((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -376,7 +362,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Flink,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -399,7 +384,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -420,7 +404,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Flink,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -443,7 +426,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Flink,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -466,7 +448,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -487,7 +468,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Flink,
|
||||
"equals",
|
||||
r#"==|="#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -510,7 +490,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -531,7 +510,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -552,7 +530,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -573,7 +550,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -594,7 +570,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -615,7 +590,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -636,7 +610,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -657,7 +630,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -678,7 +650,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -699,7 +670,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -720,7 +690,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -741,7 +710,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -762,7 +730,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -783,7 +750,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -804,7 +770,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -825,7 +790,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -846,7 +810,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -867,7 +830,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -888,7 +850,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -909,7 +870,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -930,7 +890,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -951,7 +910,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Flink,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -972,7 +930,6 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Flink,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -994,3 +951,9 @@ pub static FLINK_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "flink")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static GREENPLUM_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ALL".to_string(),
|
||||
@@ -119,7 +115,6 @@ pub static GREENPLUM_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -142,7 +137,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"inline_comment",
|
||||
r#"(--)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -165,7 +159,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"block_comment",
|
||||
r#"/\*(?>[^*/]+|\*(?!\/)|/[^*])*(?>(?R)(?>[^*/]+|\*(?!\/)|/[^*])*)*\*/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -177,7 +170,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Greenplum,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -200,7 +192,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Greenplum,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -232,7 +223,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"single_quote",
|
||||
r#"'([^']|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -262,7 +252,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"double_quote",
|
||||
r#""([^"]|"")*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -292,7 +281,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -315,7 +303,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -338,7 +325,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -361,7 +347,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -384,7 +369,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -405,7 +389,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"unicode_single_quote",
|
||||
r#"(?si)U&'([^']|'')*'(\s*UESCAPE\s*'[^0-9A-Fa-f'+\-\s)]')?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -428,7 +411,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"escaped_single_quote",
|
||||
r#"(?si)E(('')+?(?!')|'.*?((?<!\\)(?:\\\\)*(?<!')(?:'')*|(?<!\\)(?:\\\\)*\\(?<!')(?:'')*')'(?!'))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -451,7 +433,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"unicode_double_quote",
|
||||
r#"(?si)U&".+?"(\s*UESCAPE\s*\'[^0-9A-Fa-f\'+\-\s)]\')?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -474,7 +455,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"json_operator",
|
||||
r#"->>?|#>>?|@[>@?]|<@|\?[|&]?|#-"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -497,7 +477,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"pg_trgm_operator",
|
||||
r#"<<<->|<->>>|<->>|<<->(?!>)|<<%|%>>|<%|%>"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -520,7 +499,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"pgvector_operator",
|
||||
r#"<->|<#>|<=>|<\+>"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -543,7 +521,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"postgis_operator",
|
||||
r#"\&\&\&|\&<\||<<\||@|\|\&>|\|>>|\~=|<\->|\|=\||<\#>|<<\->>|<<\#>>"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -566,7 +543,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"at",
|
||||
"@",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -587,7 +563,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"bit_string_literal",
|
||||
r#"[bBxX]'[0-9a-fA-F]*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -610,7 +585,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"full_text_search_operator",
|
||||
"!!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -631,7 +605,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -654,7 +627,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -677,7 +649,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -698,7 +669,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"right_arrow",
|
||||
"=>",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -719,7 +689,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"walrus_operator",
|
||||
":=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -740,7 +709,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -761,7 +729,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -782,7 +749,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -803,7 +769,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -824,7 +789,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -845,7 +809,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -866,7 +829,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -887,7 +849,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -908,7 +869,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -929,7 +889,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -950,7 +909,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -971,7 +929,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -992,7 +949,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1013,7 +969,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1034,7 +989,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1055,7 +1009,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1076,7 +1029,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1097,7 +1049,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1118,7 +1069,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1139,7 +1089,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1160,7 +1109,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1181,7 +1129,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1202,7 +1149,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Greenplum,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1223,7 +1169,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"meta_command",
|
||||
r#"\\(?!gset|gexec)([^\\\r\n])+((\\\\)|(?=\n)|(?=\r\n))?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1246,7 +1191,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"dollar_numeric_literal",
|
||||
r#"\$\d+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1269,7 +1213,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"meta_command_query_buffer",
|
||||
r#"\\([^\\\r\n])+((\\g(set|exec))|(?=\n)|(?=\r\n))?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1292,7 +1235,6 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Greenplum,
|
||||
"word",
|
||||
r#"[\p{L}_][\p{L}\p{N}_$]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1314,3 +1256,9 @@ pub static GREENPLUM_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "greenplum")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static HIVE_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ALL".to_string(),
|
||||
@@ -155,7 +151,6 @@ pub static HIVE_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Hive,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -178,7 +173,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Hive,
|
||||
"inline_comment",
|
||||
r#"(--|#)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -201,7 +195,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Hive,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -213,7 +206,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Hive,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -236,7 +228,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Hive,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -268,7 +259,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Hive,
|
||||
"single_quote",
|
||||
r#"'([^'\\]|\\.|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -298,7 +288,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Hive,
|
||||
"double_quote",
|
||||
r#""(""|[^"\\]|\\.)*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -328,7 +317,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Hive,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -351,7 +339,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Hive,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -374,7 +361,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Hive,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -397,7 +383,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Hive,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -420,7 +405,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -441,7 +425,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Hive,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -464,7 +447,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Hive,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -487,7 +469,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -508,7 +489,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -529,7 +509,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -550,7 +529,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -571,7 +549,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -592,7 +569,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -613,7 +589,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -634,7 +609,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -655,7 +629,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -676,7 +649,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -697,7 +669,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -718,7 +689,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -739,7 +709,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -760,7 +729,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -781,7 +749,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -802,7 +769,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -823,7 +789,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -844,7 +809,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -865,7 +829,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -886,7 +849,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -907,7 +869,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -928,7 +889,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -949,7 +909,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -970,7 +929,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Hive,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -991,7 +949,6 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Hive,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1013,3 +970,9 @@ pub static HIVE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "hive")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static IMPALA_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ADD".to_string(),
|
||||
@@ -446,7 +442,6 @@ pub static IMPALA_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Impala,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -469,7 +464,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Impala,
|
||||
"inline_comment",
|
||||
r#"(--|#)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -492,7 +486,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Impala,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -504,7 +497,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Impala,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -527,7 +519,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Impala,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -559,7 +550,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Impala,
|
||||
"single_quote",
|
||||
r#"'([^'\\]|\\.|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -589,7 +579,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Impala,
|
||||
"double_quote",
|
||||
r#""(""|[^"\\]|\\.)*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -619,7 +608,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Impala,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -642,7 +630,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Impala,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -665,7 +652,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Impala,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -688,7 +674,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Impala,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -711,7 +696,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -732,7 +716,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Impala,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -755,7 +738,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Impala,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -778,7 +760,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -799,7 +780,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -820,7 +800,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -841,7 +820,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -862,7 +840,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -883,7 +860,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -904,7 +880,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -925,7 +900,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -946,7 +920,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -967,7 +940,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -988,7 +960,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1009,7 +980,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1030,7 +1000,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1051,7 +1020,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1072,7 +1040,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1093,7 +1060,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1114,7 +1080,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1135,7 +1100,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1156,7 +1120,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1177,7 +1140,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1198,7 +1160,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1219,7 +1180,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1240,7 +1200,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1261,7 +1220,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Impala,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1282,7 +1240,6 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Impala,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1304,3 +1261,9 @@ pub static IMPALA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "impala")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static MARIADB_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ACCESSIBLE".to_string(),
|
||||
@@ -266,7 +262,6 @@ pub static MARIADB_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mariadb,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -289,7 +284,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mariadb,
|
||||
"inline_comment",
|
||||
r#"(^--|-- |#)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -312,7 +306,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mariadb,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -324,7 +317,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Mariadb,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -347,7 +339,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Mariadb,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -379,7 +370,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mariadb,
|
||||
"single_quote",
|
||||
r#"(?s)('(?:\\'|''|\\\\|[^'])*'(?!'))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -409,7 +399,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mariadb,
|
||||
"double_quote",
|
||||
r#"(?s)("(?:\\"|""|\\\\|[^"])*"(?!"))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -439,7 +428,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mariadb,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -462,7 +450,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mariadb,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -485,7 +472,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mariadb,
|
||||
"hexadecimal_literal",
|
||||
r#"([xX]'([\da-fA-F][\da-fA-F])+'|0x[\da-fA-F]+)"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -508,7 +494,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mariadb,
|
||||
"bit_value_literal",
|
||||
r#"([bB]'[01]+'|0b[01]+)"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -531,7 +516,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mariadb,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -554,7 +538,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mariadb,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -577,7 +560,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -598,7 +580,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mariadb,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -621,7 +602,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mariadb,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -644,7 +624,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -665,7 +644,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"walrus_operator",
|
||||
":=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -686,7 +664,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -707,7 +684,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"inline_path_operator",
|
||||
"->>",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -728,7 +704,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"column_path_operator",
|
||||
"->",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -749,7 +724,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -770,7 +744,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -791,7 +764,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -812,7 +784,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -833,7 +804,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -854,7 +824,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -875,7 +844,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -896,7 +864,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -917,7 +884,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -938,7 +904,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -959,7 +924,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"double_ampersand",
|
||||
"&&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -980,7 +944,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1001,7 +964,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"double_vertical_bar",
|
||||
"||",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1022,7 +984,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1043,7 +1004,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1064,7 +1024,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1085,7 +1044,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1106,7 +1064,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1127,7 +1084,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1148,7 +1104,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1169,7 +1124,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1190,7 +1144,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1211,7 +1164,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1232,7 +1184,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mariadb,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1253,7 +1204,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mariadb,
|
||||
"at_sign",
|
||||
r#"@@?[a-zA-Z0-9_$]*(\.[a-zA-Z0-9_$]+)?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1276,7 +1226,6 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mariadb,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1298,3 +1247,9 @@ pub static MARIADB_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "mariadb")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static MATERIALIZE_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ALL".to_string(),
|
||||
@@ -74,7 +70,6 @@ pub static MATERIALIZE_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -97,7 +92,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"inline_comment",
|
||||
r#"(--)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -120,7 +114,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"block_comment",
|
||||
r#"/\*(?>[^*/]+|\*(?!\/)|/[^*])*(?>(?R)(?>[^*/]+|\*(?!\/)|/[^*])*)*\*/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -132,7 +125,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Materialize,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -155,7 +147,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Materialize,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -187,7 +178,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"single_quote",
|
||||
r#"'([^']|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -217,7 +207,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"double_quote",
|
||||
r#""([^"]|"")*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -247,7 +236,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -270,7 +258,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -293,7 +280,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -316,7 +302,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -339,7 +324,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -360,7 +344,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"unicode_single_quote",
|
||||
r#"(?si)U&'([^']|'')*'(\s*UESCAPE\s*'[^0-9A-Fa-f'+\-\s)]')?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -383,7 +366,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"escaped_single_quote",
|
||||
r#"(?si)E(('')+?(?!')|'.*?((?<!\\)(?:\\\\)*(?<!')(?:'')*|(?<!\\)(?:\\\\)*\\(?<!')(?:'')*')'(?!'))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -406,7 +388,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"unicode_double_quote",
|
||||
r#"(?si)U&".+?"(\s*UESCAPE\s*\'[^0-9A-Fa-f\'+\-\s)]\')?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -429,7 +410,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"json_operator",
|
||||
r#"->>?|#>>?|@[>@?]|<@|\?[|&]?|#-"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -452,7 +432,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"pg_trgm_operator",
|
||||
r#"<<<->|<->>>|<->>|<<->(?!>)|<<%|%>>|<%|%>"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -475,7 +454,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"pgvector_operator",
|
||||
r#"<->|<#>|<=>|<\+>"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -498,7 +476,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"postgis_operator",
|
||||
r#"\&\&\&|\&<\||<<\||@|\|\&>|\|>>|\~=|<\->|\|=\||<\#>|<<\->>|<<\#>>"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -521,7 +498,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"at",
|
||||
"@",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -542,7 +518,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"bit_string_literal",
|
||||
r#"[bBxX]'[0-9a-fA-F]*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -565,7 +540,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"full_text_search_operator",
|
||||
"!!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -586,7 +560,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -609,7 +582,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -632,7 +604,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -653,7 +624,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"right_arrow",
|
||||
"=>",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -674,7 +644,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"walrus_operator",
|
||||
":=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -695,7 +664,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -716,7 +684,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -737,7 +704,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -758,7 +724,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -779,7 +744,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -800,7 +764,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -821,7 +784,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -842,7 +804,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -863,7 +824,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -884,7 +844,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -905,7 +864,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -926,7 +884,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -947,7 +904,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -968,7 +924,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -989,7 +944,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1010,7 +964,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1031,7 +984,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1052,7 +1004,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1073,7 +1024,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1094,7 +1044,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1115,7 +1064,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1136,7 +1084,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1157,7 +1104,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Materialize,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1178,7 +1124,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"meta_command",
|
||||
r#"\\(?!gset|gexec)([^\\\r\n])+((\\\\)|(?=\n)|(?=\r\n))?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1201,7 +1146,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"dollar_numeric_literal",
|
||||
r#"\$\d+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1224,7 +1168,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"meta_command_query_buffer",
|
||||
r#"\\([^\\\r\n])+((\\g(set|exec))|(?=\n)|(?=\r\n))?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1247,7 +1190,6 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Materialize,
|
||||
"word",
|
||||
r#"[\p{L}_][\p{L}\p{N}_$]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1269,3 +1211,9 @@ pub static MATERIALIZE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "materialize")
|
||||
}
|
||||
@@ -59,7 +59,7 @@ use crate::dialect::tsql::matcher::{TSQL_KEYWORDS, TSQL_LEXERS};
|
||||
pub mod vertica;
|
||||
use crate::dialect::vertica::matcher::{VERTICA_KEYWORDS, VERTICA_LEXERS};
|
||||
|
||||
use crate::matcher::LexMatcher;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use std::str::FromStr;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Hash, Copy, Clone)]
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static MYSQL_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ACCESSIBLE".to_string(),
|
||||
@@ -271,7 +267,6 @@ pub static MYSQL_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mysql,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -294,7 +289,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mysql,
|
||||
"inline_comment",
|
||||
r#"(^--|-- |#)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -317,7 +311,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mysql,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -329,7 +322,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Mysql,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -352,7 +344,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Mysql,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -384,7 +375,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mysql,
|
||||
"single_quote",
|
||||
r#"(?s)('(?:\\'|''|\\\\|[^'])*'(?!'))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -414,7 +404,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mysql,
|
||||
"double_quote",
|
||||
r#"(?s)("(?:\\"|""|\\\\|[^"])*"(?!"))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -444,7 +433,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mysql,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -467,7 +455,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mysql,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -490,7 +477,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mysql,
|
||||
"hexadecimal_literal",
|
||||
r#"([xX]'([\da-fA-F][\da-fA-F])+'|0x[\da-fA-F]+)"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -513,7 +499,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mysql,
|
||||
"bit_value_literal",
|
||||
r#"([bB]'[01]+'|0b[01]+)"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -536,7 +521,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mysql,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -559,7 +543,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mysql,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -582,7 +565,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -603,7 +585,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mysql,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -626,7 +607,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mysql,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -649,7 +629,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -670,7 +649,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"walrus_operator",
|
||||
":=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -691,7 +669,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -712,7 +689,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"inline_path_operator",
|
||||
"->>",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -733,7 +709,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"column_path_operator",
|
||||
"->",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -754,7 +729,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -775,7 +749,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -796,7 +769,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -817,7 +789,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -838,7 +809,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -859,7 +829,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -880,7 +849,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -901,7 +869,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -922,7 +889,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -943,7 +909,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -964,7 +929,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"double_ampersand",
|
||||
"&&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -985,7 +949,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1006,7 +969,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"double_vertical_bar",
|
||||
"||",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1027,7 +989,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1048,7 +1009,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1069,7 +1029,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1090,7 +1049,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1111,7 +1069,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1132,7 +1089,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1153,7 +1109,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1174,7 +1129,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1195,7 +1149,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1216,7 +1169,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1237,7 +1189,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Mysql,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1258,7 +1209,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mysql,
|
||||
"at_sign",
|
||||
r#"@@?[a-zA-Z0-9_$]*(\.[a-zA-Z0-9_$]+)?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1281,7 +1231,6 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Mysql,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1303,3 +1252,9 @@ pub static MYSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "mysql")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static ORACLE_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ACCESS".to_string(),
|
||||
@@ -167,7 +163,6 @@ pub static ORACLE_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Oracle,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -190,7 +185,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Oracle,
|
||||
"inline_comment",
|
||||
r#"(--|#)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -213,7 +207,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Oracle,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -225,7 +218,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Oracle,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -248,7 +240,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Oracle,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -280,7 +271,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Oracle,
|
||||
"single_quote",
|
||||
r#"'([^'\\]|\\|\\.|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -310,7 +300,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Oracle,
|
||||
"double_quote",
|
||||
r#""([^"]|"")*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -340,7 +329,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Oracle,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -363,7 +351,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Oracle,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -386,7 +373,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Oracle,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\d+)(\.?[eE][+-]?\d+)?((?<!\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -409,7 +395,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Oracle,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -432,7 +417,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -453,7 +437,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Oracle,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -476,7 +459,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Oracle,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -499,7 +481,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -520,7 +501,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"right_arrow",
|
||||
"=>",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -541,7 +521,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"assignment_operator",
|
||||
":=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -562,7 +541,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -583,7 +561,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -604,7 +581,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -625,7 +601,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -646,7 +621,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -667,7 +641,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -688,7 +661,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -709,7 +681,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -730,7 +701,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -751,7 +721,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -772,7 +741,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -793,7 +761,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -814,7 +781,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -835,7 +801,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -856,7 +821,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"power_operator",
|
||||
"**",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -877,7 +841,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -898,7 +861,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -919,7 +881,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -940,7 +901,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -961,7 +921,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -982,7 +941,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1003,7 +961,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1024,7 +981,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1045,7 +1001,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1066,7 +1021,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Oracle,
|
||||
"prompt_command",
|
||||
r#"PROMPT([^(\r\n)])*((?=\n)|(?=\r\n))?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1089,7 +1043,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Oracle,
|
||||
"at_sign",
|
||||
"@",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1110,7 +1063,6 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Oracle,
|
||||
"word",
|
||||
r#"[\p{L}][\p{L}\p{N}_$#]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1132,3 +1084,9 @@ pub static ORACLE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "oracle")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static POSTGRES_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ALL".to_string(),
|
||||
@@ -115,7 +111,6 @@ pub static POSTGRES_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -138,7 +133,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"inline_comment",
|
||||
r#"(--)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -161,7 +155,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"block_comment",
|
||||
r#"/\*(?>[^*/]+|\*(?!\/)|/[^*])*(?>(?R)(?>[^*/]+|\*(?!\/)|/[^*])*)*\*/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -173,7 +166,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Postgres,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -196,7 +188,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Postgres,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -228,7 +219,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"single_quote",
|
||||
r#"'([^']|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -258,7 +248,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"double_quote",
|
||||
r#""([^"]|"")*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -288,7 +277,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -311,7 +299,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -334,7 +321,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -357,7 +343,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -380,7 +365,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -401,7 +385,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"unicode_single_quote",
|
||||
r#"(?si)U&'([^']|'')*'(\s*UESCAPE\s*'[^0-9A-Fa-f'+\-\s)]')?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -424,7 +407,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"escaped_single_quote",
|
||||
r#"(?si)E(('')+?(?!')|'.*?((?<!\\)(?:\\\\)*(?<!')(?:'')*|(?<!\\)(?:\\\\)*\\(?<!')(?:'')*')'(?!'))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -447,7 +429,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"unicode_double_quote",
|
||||
r#"(?si)U&".+?"(\s*UESCAPE\s*\'[^0-9A-Fa-f\'+\-\s)]\')?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -470,7 +451,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"json_operator",
|
||||
r#"->>?|#>>?|@[>@?]|<@|\?[|&]?|#-"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -493,7 +473,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"pg_trgm_operator",
|
||||
r#"<<<->|<->>>|<->>|<<->(?!>)|<<%|%>>|<%|%>"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -516,7 +495,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"pgvector_operator",
|
||||
r#"<->|<#>|<=>|<\+>"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -539,7 +517,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"postgis_operator",
|
||||
r#"\&\&\&|\&<\||<<\||@|\|\&>|\|>>|\~=|<\->|\|=\||<\#>|<<\->>|<<\#>>"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -562,7 +539,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"at",
|
||||
"@",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -583,7 +559,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"bit_string_literal",
|
||||
r#"[bBxX]'[0-9a-fA-F]*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -606,7 +581,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"full_text_search_operator",
|
||||
"!!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -627,7 +601,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -650,7 +623,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -673,7 +645,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -694,7 +665,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"right_arrow",
|
||||
"=>",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -715,7 +685,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"walrus_operator",
|
||||
":=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -736,7 +705,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -757,7 +725,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -778,7 +745,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -799,7 +765,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -820,7 +785,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -841,7 +805,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -862,7 +825,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -883,7 +845,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -904,7 +865,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -925,7 +885,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -946,7 +905,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -967,7 +925,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -988,7 +945,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1009,7 +965,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1030,7 +985,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1051,7 +1005,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1072,7 +1025,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1093,7 +1045,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1114,7 +1065,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1135,7 +1085,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1156,7 +1105,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1177,7 +1125,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1198,7 +1145,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Postgres,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1219,7 +1165,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"meta_command",
|
||||
r#"\\(?!gset|gexec)([^\\\r\n])+((\\\\)|(?=\n)|(?=\r\n))?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1242,7 +1187,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"dollar_numeric_literal",
|
||||
r#"\$\d+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1265,7 +1209,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"meta_command_query_buffer",
|
||||
r#"\\([^\\\r\n])+((\\g(set|exec))|(?=\n)|(?=\r\n))?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1288,7 +1231,6 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Postgres,
|
||||
"word",
|
||||
r#"[\p{L}_][\p{L}\p{N}_$]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1310,3 +1252,9 @@ pub static POSTGRES_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "postgres")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static REDSHIFT_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"AES128".to_string(),
|
||||
@@ -170,7 +166,6 @@ pub static REDSHIFT_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -193,7 +188,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"inline_comment",
|
||||
r#"(--)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -216,7 +210,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"block_comment",
|
||||
r#"/\*(?>[^*/]+|\*(?!\/)|/[^*])*(?>(?R)(?>[^*/]+|\*(?!\/)|/[^*])*)*\*/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -228,7 +221,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Redshift,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -251,7 +243,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Redshift,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -283,7 +274,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"single_quote",
|
||||
r#"'([^']|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -313,7 +303,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"double_quote",
|
||||
r#""([^"]|"")*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -343,7 +332,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -366,7 +354,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -389,7 +376,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -412,7 +398,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -435,7 +420,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -456,7 +440,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"unicode_single_quote",
|
||||
r#"(?si)U&'([^']|'')*'(\s*UESCAPE\s*'[^0-9A-Fa-f'+\-\s)]')?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -479,7 +462,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"escaped_single_quote",
|
||||
r#"(?si)E(('')+?(?!')|'.*?((?<!\\)(?:\\\\)*(?<!')(?:'')*|(?<!\\)(?:\\\\)*\\(?<!')(?:'')*')'(?!'))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -502,7 +484,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"unicode_double_quote",
|
||||
r#"(?si)U&".+?"(\s*UESCAPE\s*\'[^0-9A-Fa-f\'+\-\s)]\')?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -525,7 +506,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"json_operator",
|
||||
r#"->>?|#>>?|@[>@?]|<@|\?[|&]?|#-"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -548,7 +528,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"pg_trgm_operator",
|
||||
r#"<<<->|<->>>|<->>|<<->(?!>)|<<%|%>>|<%|%>"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -571,7 +550,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"pgvector_operator",
|
||||
r#"<->|<#>|<=>|<\+>"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -594,7 +572,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"postgis_operator",
|
||||
r#"\&\&\&|\&<\||<<\||@|\|\&>|\|>>|\~=|<\->|\|=\||<\#>|<<\->>|<<\#>>"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -617,7 +594,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"at",
|
||||
"@",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -638,7 +614,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"bit_string_literal",
|
||||
r#"[bBxX]'[0-9a-fA-F]*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -661,7 +636,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"full_text_search_operator",
|
||||
"!!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -682,7 +656,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -705,7 +678,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -728,7 +700,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -749,7 +720,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"right_arrow",
|
||||
"=>",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -770,7 +740,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"walrus_operator",
|
||||
":=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -791,7 +760,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -812,7 +780,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -833,7 +800,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -854,7 +820,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -875,7 +840,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -896,7 +860,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -917,7 +880,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -938,7 +900,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -959,7 +920,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -980,7 +940,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1001,7 +960,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1022,7 +980,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1043,7 +1000,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1064,7 +1020,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1085,7 +1040,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1106,7 +1060,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1127,7 +1080,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1148,7 +1100,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1169,7 +1120,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1190,7 +1140,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1211,7 +1160,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1232,7 +1180,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1253,7 +1200,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Redshift,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1274,7 +1220,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"meta_command",
|
||||
r#"\\(?!gset|gexec)([^\\\r\n])+((\\\\)|(?=\n)|(?=\r\n))?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1297,7 +1242,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"dollar_numeric_literal",
|
||||
r#"\$\d+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1320,7 +1264,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"meta_command_query_buffer",
|
||||
r#"\\([^\\\r\n])+((\\g(set|exec))|(?=\n)|(?=\r\n))?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1343,7 +1286,6 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Redshift,
|
||||
"word",
|
||||
r#"#?[0-9a-zA-Z_]+[0-9a-zA-Z_$]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1365,3 +1307,9 @@ pub static REDSHIFT_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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")
|
||||
}
|
||||
18
sqlfluffrs/sqlfluffrs_dialects/src/dialect/segment.rs
Normal file
18
sqlfluffrs/sqlfluffrs_dialects/src/dialect/segment.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
// match_grammar = Delimited(
|
||||
// Ref("StatementSegment"),
|
||||
// delimiter=AnyNumberOf(Ref("DelimiterGrammar"), min_times=1),
|
||||
// allow_gaps=True,
|
||||
// allow_trailing=True,
|
||||
// )
|
||||
|
||||
pub fn file_segment(tokens: Vec<Token>) -> Segment {
|
||||
|
||||
// match_grammar:
|
||||
// Delimited(
|
||||
// Ref("StatementSegment"),
|
||||
// delimiter=AnyNumberOf(Ref("DelimiterGrammar"), min_times=1),
|
||||
// allow_gaps=True,
|
||||
// allow_trailing=True,
|
||||
// )
|
||||
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static SNOWFLAKE_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ALL".to_string(),
|
||||
@@ -105,7 +101,6 @@ pub static SNOWFLAKE_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Snowflake,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -128,7 +123,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Snowflake,
|
||||
"inline_comment",
|
||||
r#"(--|#|//)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -151,7 +145,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Snowflake,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -163,7 +156,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Snowflake,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -186,7 +178,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Snowflake,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -218,7 +209,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Snowflake,
|
||||
"single_quote",
|
||||
r#"'([^'\\]|\\.|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -248,7 +238,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Snowflake,
|
||||
"double_quote",
|
||||
r#""(""|[^"\\]|\\.)*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -278,7 +267,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Snowflake,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -301,7 +289,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Snowflake,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -324,7 +311,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Snowflake,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -347,7 +333,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Snowflake,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -370,7 +355,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -391,7 +375,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"parameter_assigner",
|
||||
"=>",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -412,7 +395,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"right_arrow",
|
||||
"->",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -433,7 +415,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Snowflake,
|
||||
"stage_path",
|
||||
r#"(?:@[^\s;)]+|'@[^']+')"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -456,7 +437,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Snowflake,
|
||||
"column_selector",
|
||||
r#"\$[0-9]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -479,7 +459,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Snowflake,
|
||||
"dollar_quote",
|
||||
r#"\$\$.*\$\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -502,7 +481,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Snowflake,
|
||||
"dollar_literal",
|
||||
r#"[$][a-zA-Z0-9_.]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -525,7 +503,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Snowflake,
|
||||
"inline_dollar_sign",
|
||||
r#"[a-zA-Z_][a-zA-Z0-9_$]*\$[a-zA-Z0-9_$]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -548,7 +525,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Snowflake,
|
||||
"unquoted_file_path",
|
||||
r#"file://(?:[a-zA-Z]+:|/)+(?:[0-9a-zA-Z\\/_*?-]+)(?:\.[0-9a-zA-Z]+)?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -571,7 +547,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"question_mark",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -592,7 +567,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"exclude_bracket_open",
|
||||
"{-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -613,7 +587,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"exclude_bracket_close",
|
||||
"-}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -634,7 +607,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Snowflake,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -657,7 +629,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Snowflake,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -680,7 +651,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -701,7 +671,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"walrus_operator",
|
||||
":=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -722,7 +691,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -743,7 +711,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -764,7 +731,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -785,7 +751,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -806,7 +771,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -827,7 +791,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -848,7 +811,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -869,7 +831,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -890,7 +851,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -911,7 +871,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -932,7 +891,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -953,7 +911,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -974,7 +931,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -995,7 +951,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1016,7 +971,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1037,7 +991,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1058,7 +1011,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1079,7 +1031,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1100,7 +1051,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1121,7 +1071,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1142,7 +1091,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1163,7 +1111,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1184,7 +1131,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Snowflake,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1205,7 +1151,6 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Snowflake,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1227,3 +1172,9 @@ pub static SNOWFLAKE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "snowflake")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static SOQL_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"CASE".to_string(),
|
||||
@@ -72,7 +68,6 @@ pub static SOQL_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Soql,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -95,7 +90,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Soql,
|
||||
"inline_comment",
|
||||
r#"(--|#)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -118,7 +112,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Soql,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -130,7 +123,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Soql,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -153,7 +145,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Soql,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -185,7 +176,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Soql,
|
||||
"single_quote",
|
||||
r#"'([^'\\]|\\.|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -215,7 +205,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Soql,
|
||||
"double_quote",
|
||||
r#""(""|[^"\\]|\\.)*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -245,7 +234,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Soql,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -268,7 +256,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Soql,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -291,7 +278,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Soql,
|
||||
"datetime_literal",
|
||||
r#"[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(Z|(\+|\-)[0-9]{2}:[0-9]{2})"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -314,7 +300,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Soql,
|
||||
"date_literal",
|
||||
r#"[0-9]{4}-[0-9]{2}-[0-9]{2}"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -337,7 +322,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Soql,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -360,7 +344,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Soql,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -383,7 +366,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -404,7 +386,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Soql,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -427,7 +408,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Soql,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -450,7 +430,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -471,7 +450,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -492,7 +470,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -513,7 +490,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -534,7 +510,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -555,7 +530,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -576,7 +550,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -597,7 +570,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -618,7 +590,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -639,7 +610,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -660,7 +630,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -681,7 +650,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -702,7 +670,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -723,7 +690,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -744,7 +710,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -765,7 +730,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -786,7 +750,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -807,7 +770,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -828,7 +790,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -849,7 +810,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -870,7 +830,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -891,7 +850,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -912,7 +870,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -933,7 +890,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Soql,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -954,7 +910,6 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Soql,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -976,3 +931,9 @@ pub static SOQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "soql")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static SPARKSQL_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ALL".to_string(),
|
||||
@@ -86,7 +82,6 @@ pub static SPARKSQL_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sparksql,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -109,7 +104,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sparksql,
|
||||
"inline_comment",
|
||||
r#"(--)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -132,7 +126,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"start_hint",
|
||||
"/*+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -153,7 +146,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sparksql,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -165,7 +157,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Sparksql,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -188,7 +179,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Sparksql,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -220,7 +210,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sparksql,
|
||||
"raw_single_quote",
|
||||
r#"[rR]'([^'\\]|\\.)*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -243,7 +232,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sparksql,
|
||||
"raw_double_quote",
|
||||
r#"[rR]"([^"\\]|\\.)*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -266,7 +254,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sparksql,
|
||||
"bytes_single_quote",
|
||||
r#"X'([^'\\]|\\.)*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -289,7 +276,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sparksql,
|
||||
"bytes_double_quote",
|
||||
r#"X"([^"\\]|\\.)*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -312,7 +298,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"end_hint",
|
||||
"*/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -333,7 +318,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sparksql,
|
||||
"single_quote",
|
||||
r#"'([^'\\]|\\.|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -363,7 +347,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sparksql,
|
||||
"double_quote",
|
||||
r#""(""|[^"\\]|\\.)*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -393,7 +376,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sparksql,
|
||||
"back_quote",
|
||||
r#"`([^`]|``)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -416,7 +398,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sparksql,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -439,7 +420,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sparksql,
|
||||
"numeric_literal",
|
||||
r#"(?>(?>\d+\.\d+|\d+\.|\.\d+)([eE][+-]?\d+)?([dDfF]|BD|bd)?|\d+[eE][+-]?\d+([dDfF]|BD|bd)?|\d+([dDfFlLsSyY]|BD|bd)?)((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -462,7 +442,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sparksql,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -485,7 +464,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -506,7 +484,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"right_arrow",
|
||||
"->",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -527,7 +504,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sparksql,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -550,7 +526,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sparksql,
|
||||
"file_literal",
|
||||
r#"[a-zA-Z0-9]+:([a-zA-Z0-9\-_\.]*(\/|\\)){2,}((([a-zA-Z0-9\-_\.]*(:|\?|=|&)[a-zA-Z0-9\-_\.]*)+)|([a-zA-Z0-9\-_\.]*\.[a-z]+))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -573,7 +548,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sparksql,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -596,7 +570,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -617,7 +590,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sparksql,
|
||||
"equals",
|
||||
r#"==|<=>|="#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -640,7 +612,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -661,7 +632,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -682,7 +652,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -703,7 +672,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -724,7 +692,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -745,7 +712,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -766,7 +732,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -787,7 +752,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -808,7 +772,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -829,7 +792,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -850,7 +812,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -871,7 +832,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -892,7 +852,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -913,7 +872,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -934,7 +892,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -955,7 +912,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -976,7 +932,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -997,7 +952,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1018,7 +972,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1039,7 +992,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1060,7 +1012,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1081,7 +1032,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sparksql,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1102,7 +1052,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sparksql,
|
||||
"at_sign_literal",
|
||||
r#"@\w*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1125,7 +1074,6 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sparksql,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1147,3 +1095,9 @@ pub static SPARKSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "sparksql")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static SQLITE_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ABORT".to_string(),
|
||||
@@ -157,7 +153,6 @@ pub static SQLITE_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sqlite,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -180,7 +175,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sqlite,
|
||||
"inline_comment",
|
||||
r#"(--|#)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -203,7 +197,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sqlite,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*(\*\/|\Z)"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -215,7 +208,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Sqlite,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -238,7 +230,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Sqlite,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -270,7 +261,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sqlite,
|
||||
"single_quote",
|
||||
r#"'([^']|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -300,7 +290,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sqlite,
|
||||
"double_quote",
|
||||
r#""([^"]|"")*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -330,7 +319,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sqlite,
|
||||
"back_quote",
|
||||
r#"`([^`]|``)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -353,7 +341,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sqlite,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -376,7 +363,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sqlite,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -399,7 +385,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sqlite,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -422,7 +407,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -443,7 +427,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sqlite,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -466,7 +449,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sqlite,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -489,7 +471,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -510,7 +491,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -531,7 +511,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"inline_path_operator",
|
||||
"->>",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -552,7 +531,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"column_path_operator",
|
||||
"->",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -573,7 +551,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -594,7 +571,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -615,7 +591,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -636,7 +611,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -657,7 +631,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -678,7 +651,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -699,7 +671,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -720,7 +691,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -741,7 +711,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -762,7 +731,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sqlite,
|
||||
"at_sign_literal",
|
||||
r#"@[a-zA-Z0-9_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -785,7 +753,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sqlite,
|
||||
"colon_literal",
|
||||
r#":[a-zA-Z0-9_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -808,7 +775,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sqlite,
|
||||
"question_literal",
|
||||
r#"\?[0-9]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -831,7 +797,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sqlite,
|
||||
"dollar_literal",
|
||||
r#"\$[a-zA-Z0-9_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -854,7 +819,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -875,7 +839,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -896,7 +859,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -917,7 +879,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -938,7 +899,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -959,7 +919,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -980,7 +939,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1001,7 +959,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1022,7 +979,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1043,7 +999,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1064,7 +1019,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1085,7 +1039,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1106,7 +1059,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Sqlite,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1127,7 +1079,6 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Sqlite,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1149,3 +1100,9 @@ pub static SQLITE_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "sqlite")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static STARROCKS_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ACCESSIBLE".to_string(),
|
||||
@@ -270,7 +266,6 @@ pub static STARROCKS_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Starrocks,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -293,7 +288,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Starrocks,
|
||||
"inline_comment",
|
||||
r#"(^--|-- |#)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -316,7 +310,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Starrocks,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -328,7 +321,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Starrocks,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -351,7 +343,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Starrocks,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -383,7 +374,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Starrocks,
|
||||
"single_quote",
|
||||
r#"(?s)('(?:\\'|''|\\\\|[^'])*'(?!'))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -413,7 +403,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Starrocks,
|
||||
"double_quote",
|
||||
r#"(?s)("(?:\\"|""|\\\\|[^"])*"(?!"))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -443,7 +432,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Starrocks,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -466,7 +454,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Starrocks,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -489,7 +476,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Starrocks,
|
||||
"hexadecimal_literal",
|
||||
r#"([xX]'([\da-fA-F][\da-fA-F])+'|0x[\da-fA-F]+)"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -512,7 +498,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Starrocks,
|
||||
"bit_value_literal",
|
||||
r#"([bB]'[01]+'|0b[01]+)"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -535,7 +520,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Starrocks,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -558,7 +542,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Starrocks,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -581,7 +564,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -602,7 +584,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Starrocks,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -625,7 +606,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Starrocks,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -648,7 +628,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -669,7 +648,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"walrus_operator",
|
||||
":=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -690,7 +668,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -711,7 +688,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"inline_path_operator",
|
||||
"->>",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -732,7 +708,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"column_path_operator",
|
||||
"->",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -753,7 +728,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -774,7 +748,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -795,7 +768,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -816,7 +788,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -837,7 +808,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -858,7 +828,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -879,7 +848,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -900,7 +868,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -921,7 +888,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -942,7 +908,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -963,7 +928,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"double_ampersand",
|
||||
"&&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -984,7 +948,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1005,7 +968,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"double_vertical_bar",
|
||||
"||",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1026,7 +988,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1047,7 +1008,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1068,7 +1028,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1089,7 +1048,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1110,7 +1068,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1131,7 +1088,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1152,7 +1108,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1173,7 +1128,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1194,7 +1148,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1215,7 +1168,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1236,7 +1188,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Starrocks,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1257,7 +1208,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Starrocks,
|
||||
"at_sign",
|
||||
r#"@@?[a-zA-Z0-9_$]*(\.[a-zA-Z0-9_$]+)?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1280,7 +1230,6 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Starrocks,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1302,3 +1251,9 @@ pub static STARROCKS_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "starrocks")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static TERADATA_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"CASE".to_string(),
|
||||
@@ -38,7 +34,6 @@ pub static TERADATA_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Teradata,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -61,7 +56,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Teradata,
|
||||
"inline_comment",
|
||||
r#"(--|#)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -84,7 +78,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Teradata,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -96,7 +89,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Teradata,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -119,7 +111,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Teradata,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -151,7 +142,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Teradata,
|
||||
"single_quote",
|
||||
r#"'([^'\\]|\\.|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -181,7 +171,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Teradata,
|
||||
"double_quote",
|
||||
r#""(""|[^"\\]|\\.)*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -211,7 +200,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Teradata,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -234,7 +222,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Teradata,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -257,7 +244,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Teradata,
|
||||
"numeric_literal",
|
||||
r#"([0-9]+(\.[0-9]*)?)"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -280,7 +266,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Teradata,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -303,7 +288,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -324,7 +308,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Teradata,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -347,7 +330,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Teradata,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -370,7 +352,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -391,7 +372,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -412,7 +392,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -433,7 +412,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -454,7 +432,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -475,7 +452,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -496,7 +472,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -517,7 +492,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -538,7 +512,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -559,7 +532,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -580,7 +552,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -601,7 +572,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -622,7 +592,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -643,7 +612,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -664,7 +632,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -685,7 +652,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -706,7 +672,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -727,7 +692,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -748,7 +712,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -769,7 +732,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -790,7 +752,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -811,7 +772,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -832,7 +792,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -853,7 +812,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Teradata,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -874,7 +832,6 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Teradata,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -896,3 +853,9 @@ pub static TERADATA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "teradata")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static TRINO_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ALTER".to_string(),
|
||||
@@ -96,7 +92,6 @@ pub static TRINO_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Trino,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -119,7 +114,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Trino,
|
||||
"inline_comment",
|
||||
r#"(--|#)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -142,7 +136,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Trino,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -154,7 +147,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Trino,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -177,7 +169,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Trino,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -209,7 +200,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Trino,
|
||||
"single_quote",
|
||||
r#"'([^'\\]|\\.|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -239,7 +229,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Trino,
|
||||
"double_quote",
|
||||
r#""([^"]|"")*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -269,7 +258,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Trino,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -292,7 +280,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Trino,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -315,7 +302,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Trino,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -338,7 +324,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Trino,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -361,7 +346,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -382,7 +366,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"right_arrow",
|
||||
"->",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -403,7 +386,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"fat_right_arrow",
|
||||
"=>",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -424,7 +406,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Trino,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -447,7 +428,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Trino,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -470,7 +450,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -491,7 +470,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -512,7 +490,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -533,7 +510,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -554,7 +530,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -575,7 +550,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -596,7 +570,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -617,7 +590,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -638,7 +610,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -659,7 +630,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -680,7 +650,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -701,7 +670,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -722,7 +690,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -743,7 +710,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -764,7 +730,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -785,7 +750,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -806,7 +770,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -827,7 +790,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -848,7 +810,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -869,7 +830,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -890,7 +850,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -911,7 +870,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -932,7 +890,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -953,7 +910,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Trino,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -974,7 +930,6 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Trino,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -996,3 +951,9 @@ pub static TRINO_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "trino")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static TSQL_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ADD".to_string(),
|
||||
@@ -199,7 +195,6 @@ pub static TSQL_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Tsql,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -222,7 +217,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Tsql,
|
||||
"inline_comment",
|
||||
r#"(--)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -245,7 +239,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Tsql,
|
||||
"block_comment",
|
||||
r#"/\*(?>[^*/]+|\*(?!\/)|/[^*])*(?>(?R)(?>[^*/]+|\*(?!\/)|/[^*])*)*\*/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -257,7 +250,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Tsql,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -280,7 +272,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Tsql,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -312,7 +303,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Tsql,
|
||||
"single_quote",
|
||||
r#"'([^']|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -342,7 +332,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Tsql,
|
||||
"double_quote",
|
||||
r#""(""|[^"\\]|\\.)*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -372,7 +361,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Tsql,
|
||||
"atsign",
|
||||
r#"[@][a-zA-Z0-9_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -395,7 +383,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Tsql,
|
||||
"var_prefix",
|
||||
r#"[$][a-zA-Z0-9_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -418,7 +405,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Tsql,
|
||||
"square_quote",
|
||||
r#"\[([^\[\]]*)*\]"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -441,7 +427,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Tsql,
|
||||
"single_quote_with_n",
|
||||
r#"N'([^']|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -464,7 +449,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Tsql,
|
||||
"hash_prefix",
|
||||
r#"[#][#]?[a-zA-Z0-9_]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -487,7 +471,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Tsql,
|
||||
"unquoted_relative_sql_file_path",
|
||||
r#"[.\w\\/#-]+\.[sS][qQ][lL]\b"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -510,7 +493,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Tsql,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -533,7 +515,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Tsql,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -556,7 +537,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Tsql,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -579,7 +559,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Tsql,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -602,7 +581,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"glob_operator",
|
||||
"~~~",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -623,7 +601,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Tsql,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -646,7 +623,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Tsql,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -669,7 +645,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -690,7 +665,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -711,7 +685,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -732,7 +705,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -753,7 +725,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -774,7 +745,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -795,7 +765,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -816,7 +785,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -837,7 +805,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -858,7 +825,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -879,7 +845,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -900,7 +865,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -921,7 +885,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -942,7 +905,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -963,7 +925,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -984,7 +945,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1005,7 +965,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1026,7 +985,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1047,7 +1005,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1068,7 +1025,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1089,7 +1045,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1110,7 +1065,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1131,7 +1085,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1152,7 +1105,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Tsql,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1173,7 +1125,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Tsql,
|
||||
"numeric_literal",
|
||||
r#"([xX]'([\da-fA-F][\da-fA-F])+'|0[xX][\da-fA-F]*)"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1196,7 +1147,6 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Tsql,
|
||||
"word",
|
||||
r#"[0-9a-zA-Z_#@\p{L}]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1218,3 +1168,9 @@ pub static TSQL_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "tsql")
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
/* This is a generated file! */
|
||||
use once_cell::sync::Lazy;
|
||||
use crate::matcher::{LexMatcher, extract_nested_block_comment};
|
||||
use crate::token::Token;
|
||||
use crate::token::config::TokenConfig;
|
||||
use crate::regex::RegexModeGroup;
|
||||
use crate::dialect::Dialect;
|
||||
use hashbrown::HashSet;
|
||||
use sqlfluffrs_types::LexMatcher;
|
||||
use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};
|
||||
|
||||
pub static VERTICA_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
"ALL".to_string(),
|
||||
@@ -112,7 +108,6 @@ pub static VERTICA_KEYWORDS: Lazy<Vec<String>> = Lazy::new(|| { vec![
|
||||
pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Vertica,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -135,7 +130,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Vertica,
|
||||
"inline_comment",
|
||||
r#"(--|#)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -158,7 +152,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Vertica,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -170,7 +163,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
},
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Vertica,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -193,7 +185,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
))),
|
||||
Some(Box::new(
|
||||
LexMatcher::regex_subdivider(
|
||||
Dialect::Vertica,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -225,7 +216,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Vertica,
|
||||
"single_quote",
|
||||
r#"'([^'\\]|\\.|'')*'"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -255,7 +245,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Vertica,
|
||||
"double_quote",
|
||||
r#""([^"]|"")*""#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -285,7 +274,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Vertica,
|
||||
"back_quote",
|
||||
r#"`(?:[^`\\]|\\.)*`"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -308,7 +296,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Vertica,
|
||||
"dollar_quote",
|
||||
r#"\$(\w*)\$(.*?)\$\1\$"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -331,7 +318,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Vertica,
|
||||
"numeric_literal",
|
||||
r#"(?>\d+\.\d+|\d+\.(?![\.\w])|\.\d+|\d+)(\.?[eE][+-]?\d+)?((?<=\.)|(?=\b))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -354,7 +340,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Vertica,
|
||||
"obevo_annotation",
|
||||
r#"////\s*(CHANGE|BODY|METADATA)[^\n]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -377,7 +362,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec+?(?!')|'.*?((?<!\\)(?:\\\\)*(?<!')(?:'')*|(?<!\\)(?:\\\\)*\\(?<!')(?:'')*')'(?!'))"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -421,7 +404,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Vertica,
|
||||
"like_operator",
|
||||
r#"!?~~?\*?"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -444,7 +426,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Vertica,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -467,7 +448,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"null_casting_operator",
|
||||
"::!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -488,7 +468,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"casting_operator",
|
||||
"::",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -509,7 +488,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"equals",
|
||||
"=",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -530,7 +508,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"greater_than",
|
||||
">",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -551,7 +528,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"null_equals_operator",
|
||||
"<=>",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -572,7 +548,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"less_than",
|
||||
"<",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -593,7 +568,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"not",
|
||||
"!",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -614,7 +588,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"dot",
|
||||
".",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -635,7 +608,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"comma",
|
||||
",",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -656,7 +628,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"plus",
|
||||
"+",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -677,7 +648,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"minus",
|
||||
"-",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -698,7 +668,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"integer_division",
|
||||
"//",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -719,7 +688,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"divide",
|
||||
"/",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -740,7 +708,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"percent",
|
||||
"%",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -761,7 +728,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"question",
|
||||
"?",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -782,7 +748,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"ampersand",
|
||||
"&",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -803,7 +768,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"vertical_bar",
|
||||
"|",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -824,7 +788,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"caret",
|
||||
"^",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -845,7 +808,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"star",
|
||||
"*",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -866,7 +828,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"start_bracket",
|
||||
"(",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -887,7 +848,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"end_bracket",
|
||||
")",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -908,7 +868,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"start_square_bracket",
|
||||
"[",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -929,7 +888,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"end_square_bracket",
|
||||
"]",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -950,7 +908,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"start_curly_bracket",
|
||||
"{",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -971,7 +928,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"end_curly_bracket",
|
||||
"}",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -992,7 +948,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"colon",
|
||||
":",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1013,7 +968,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::string_lexer(
|
||||
Dialect::Vertica,
|
||||
"semicolon",
|
||||
";",
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1034,7 +988,6 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
),
|
||||
|
||||
LexMatcher::regex_lexer(
|
||||
Dialect::Vertica,
|
||||
"word",
|
||||
r#"[\p{L}_][\p{L}\p{N}_$]*"#,
|
||||
|raw, pos_marker, class_types, instance_types, trim_start, trim_chars,
|
||||
@@ -1056,3 +1009,9 @@ pub static VERTICA_LEXERS: Lazy<Vec<LexMatcher>> = Lazy::new(|| { vec![
|
||||
None,
|
||||
),
|
||||
]});
|
||||
|
||||
|
||||
// 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, "vertica")
|
||||
}
|
||||
5
sqlfluffrs/sqlfluffrs_dialects/src/lib.rs
Normal file
5
sqlfluffrs/sqlfluffrs_dialects/src/lib.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
pub mod dialect;
|
||||
pub mod block_comment;
|
||||
|
||||
pub use dialect::*;
|
||||
pub use block_comment::extract_nested_block_comment;
|
||||
21
sqlfluffrs/sqlfluffrs_lexer/Cargo.toml
Normal file
21
sqlfluffrs/sqlfluffrs_lexer/Cargo.toml
Normal file
@@ -0,0 +1,21 @@
|
||||
[package]
|
||||
name = "sqlfluffrs_lexer"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
env_logger = "0.11.8"
|
||||
regex = { version = "1.11.2", features = ["perf"] }
|
||||
fancy-regex = "0.16.2"
|
||||
hashbrown = "0.15.5"
|
||||
log = "0.4.28"
|
||||
itertools = "0.14.0"
|
||||
serde = { version = "1.0.225", features = ["derive"] }
|
||||
uuid = { version = "1.18.1", features = ["v4"] }
|
||||
sqlfluffrs_types = { path = "../sqlfluffrs_types" }
|
||||
sqlfluffrs_dialects = { path = "../sqlfluffrs_dialects" }
|
||||
pyo3 = { version = "0.26.0", optional = true, features = ["hashbrown", "extension-module", "uuid"] }
|
||||
pyo3-log = { version = "0.13.0", optional = true }
|
||||
|
||||
[features]
|
||||
unicode = []
|
||||
python = ["unicode", "pyo3", "sqlfluffrs_types/python"]
|
||||
1728
sqlfluffrs/sqlfluffrs_lexer/src/lexer.rs
Normal file
1728
sqlfluffrs/sqlfluffrs_lexer/src/lexer.rs
Normal file
File diff suppressed because it is too large
Load Diff
5
sqlfluffrs/sqlfluffrs_lexer/src/lib.rs
Normal file
5
sqlfluffrs/sqlfluffrs_lexer/src/lib.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
pub(crate) mod lexer;
|
||||
|
||||
#[cfg(feature = "python")]
|
||||
pub use lexer::python::{PyLexer, PySQLLexError};
|
||||
pub use lexer::{LexInput, Lexer, TemplateElement};
|
||||
19
sqlfluffrs/sqlfluffrs_types/Cargo.toml
Normal file
19
sqlfluffrs/sqlfluffrs_types/Cargo.toml
Normal file
@@ -0,0 +1,19 @@
|
||||
[package]
|
||||
name = "sqlfluffrs_types"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
hashbrown = "0.15.5"
|
||||
regex = { version = "1.12.2", features = ["perf"] }
|
||||
log = "0.4.28"
|
||||
serde = { version = "1.0.225", features = ["derive"] }
|
||||
uuid = { version = "1.18.1", features = ["v4"] }
|
||||
fancy-regex = "0.16.2"
|
||||
pyo3 = { version = "0.26.0", optional = true, features = ["hashbrown", "extension-module", "uuid"] }
|
||||
pyo3-log = { version = "0.13.0", optional = true }
|
||||
bincode = "1.3.3"
|
||||
once_cell = "1.21.3"
|
||||
|
||||
[features]
|
||||
unicode = []
|
||||
python = ["unicode", "pyo3"]
|
||||
26
sqlfluffrs/sqlfluffrs_types/src/lib.rs
Normal file
26
sqlfluffrs/sqlfluffrs_types/src/lib.rs
Normal file
@@ -0,0 +1,26 @@
|
||||
pub mod config;
|
||||
pub mod marker;
|
||||
pub mod matcher;
|
||||
pub mod regex;
|
||||
pub mod slice;
|
||||
pub mod templater;
|
||||
pub mod token;
|
||||
|
||||
pub use config::fluffconfig::FluffConfig;
|
||||
pub use matcher::LexMatcher;
|
||||
pub use marker::PositionMarker;
|
||||
pub use regex::{RegexMode, RegexModeGroup};
|
||||
pub use slice::Slice;
|
||||
pub use templater::fileslice::{RawFileSlice, TemplatedFileSlice};
|
||||
pub use templater::templatefile::TemplatedFile;
|
||||
pub use token::{Token, config::TokenConfig};
|
||||
#[cfg(feature = "python")]
|
||||
pub use marker::python::PyPositionMarker;
|
||||
#[cfg(feature = "python")]
|
||||
pub use token::python::PyToken;
|
||||
#[cfg(feature = "python")]
|
||||
pub use config::fluffconfig::python::PyFluffConfig;
|
||||
#[cfg(feature = "python")]
|
||||
pub use templater::fileslice::python::{PyRawFileSlice, PyTemplatedFileSlice};
|
||||
#[cfg(feature = "python")]
|
||||
pub use templater::templatefile::python::PyTemplatedFile;
|
||||
@@ -4,25 +4,22 @@ use fancy_regex::{Regex as FancyRegex, RegexBuilder as FancyRegexBuilder};
|
||||
use hashbrown::HashSet;
|
||||
use regex::{Regex, RegexBuilder};
|
||||
|
||||
use crate::{
|
||||
dialect::Dialect,
|
||||
marker::PositionMarker,
|
||||
regex::RegexModeGroup,
|
||||
token::Token,
|
||||
};
|
||||
use crate::{PositionMarker, RegexModeGroup, Token};
|
||||
|
||||
// use sqlfluffrs_dialects::Dialect;
|
||||
|
||||
/// Legacy function pointer type for token generation (maintains backward compatibility)
|
||||
/// This signature accepts individual parameters and constructs a TokenConfig internally
|
||||
pub type TokenGenerator = fn(
|
||||
String, // raw
|
||||
PositionMarker, // pos_marker
|
||||
HashSet<String>, // class_types
|
||||
Vec<String>, // instance_types
|
||||
Option<Vec<String>>, // trim_start
|
||||
Option<Vec<String>>, // trim_chars
|
||||
Option<(String, RegexModeGroup)>, // quoted_value
|
||||
Option<(String, String)>, // escape_replacement
|
||||
Option<fn(&str) -> str>, // casefold
|
||||
String, // raw
|
||||
PositionMarker, // pos_marker
|
||||
HashSet<String>, // class_types
|
||||
Vec<String>, // instance_types
|
||||
Option<Vec<String>>, // trim_start
|
||||
Option<Vec<String>>, // trim_chars
|
||||
Option<(String, RegexModeGroup)>, // quoted_value
|
||||
Option<(String, String)>, // escape_replacement
|
||||
Option<fn(&str) -> str>, // casefold
|
||||
) -> Token;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@@ -30,7 +27,7 @@ pub enum LexerMode {
|
||||
String(String), // Match a literal string
|
||||
Regex(Regex, fn(&str) -> bool), // Match using a regex
|
||||
FancyRegex(FancyRegex, fn(&str) -> bool), // Match using a regex
|
||||
Function(fn(&str, Dialect) -> Option<&str>),
|
||||
Function(fn(&str) -> Option<&str>),
|
||||
}
|
||||
|
||||
impl Display for LexerMode {
|
||||
@@ -57,7 +54,7 @@ impl<'a> LexedElement<'a> {
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct LexMatcher {
|
||||
pub dialect: Dialect,
|
||||
// pub dialect: Dialect,
|
||||
pub name: String,
|
||||
pub mode: LexerMode,
|
||||
pub token_class_func: TokenGenerator,
|
||||
@@ -79,7 +76,7 @@ impl Display for LexMatcher {
|
||||
|
||||
impl LexMatcher {
|
||||
pub fn string_lexer(
|
||||
dialect: Dialect,
|
||||
// dialect: Dialect,
|
||||
name: &str,
|
||||
template: &str,
|
||||
token_class_func: TokenGenerator,
|
||||
@@ -93,7 +90,7 @@ impl LexMatcher {
|
||||
kwarg_type: Option<String>,
|
||||
) -> Self {
|
||||
Self {
|
||||
dialect,
|
||||
// dialect,
|
||||
name: name.to_string(),
|
||||
mode: LexerMode::String(template.to_string()),
|
||||
token_class_func,
|
||||
@@ -109,7 +106,7 @@ impl LexMatcher {
|
||||
}
|
||||
|
||||
fn base_regex_lexer(
|
||||
dialect: Dialect,
|
||||
// dialect: Dialect,
|
||||
name: &str,
|
||||
pattern: &str,
|
||||
token_class_func: TokenGenerator,
|
||||
@@ -120,7 +117,7 @@ impl LexMatcher {
|
||||
quoted_value: Option<(String, RegexModeGroup)>,
|
||||
escape_replacements: Option<(String, String)>,
|
||||
casefold: Option<fn(&str) -> str>,
|
||||
fallback_lexer: Option<fn(&str, Dialect) -> Option<&str>>,
|
||||
fallback_lexer: Option<fn(&str) -> Option<&str>>,
|
||||
precheck: fn(&str) -> bool,
|
||||
kwarg_type: Option<String>,
|
||||
) -> Self {
|
||||
@@ -142,7 +139,7 @@ impl LexMatcher {
|
||||
};
|
||||
|
||||
Self {
|
||||
dialect,
|
||||
// dialect,
|
||||
name: name.to_string(),
|
||||
mode,
|
||||
token_class_func,
|
||||
@@ -158,7 +155,7 @@ impl LexMatcher {
|
||||
}
|
||||
|
||||
pub fn regex_lexer(
|
||||
dialect: Dialect,
|
||||
// dialect: Dialect,
|
||||
name: &str,
|
||||
template: &str,
|
||||
token_class_func: TokenGenerator,
|
||||
@@ -169,13 +166,13 @@ impl LexMatcher {
|
||||
quoted_value: Option<(String, RegexModeGroup)>,
|
||||
escape_replacements: Option<(String, String)>,
|
||||
casefold: Option<fn(&str) -> str>,
|
||||
fallback_lexer: Option<fn(&str, Dialect) -> Option<&str>>,
|
||||
fallback_lexer: Option<fn(&str) -> Option<&str>>,
|
||||
precheck: fn(&str) -> bool,
|
||||
kwarg_type: Option<String>,
|
||||
) -> Self {
|
||||
let pattern = format!(r"(?s)\A(?:{})", template);
|
||||
Self::base_regex_lexer(
|
||||
dialect,
|
||||
// dialect,
|
||||
name,
|
||||
&pattern,
|
||||
token_class_func,
|
||||
@@ -193,7 +190,7 @@ impl LexMatcher {
|
||||
}
|
||||
|
||||
pub fn regex_subdivider(
|
||||
dialect: Dialect,
|
||||
// dialect: Dialect,
|
||||
name: &str,
|
||||
template: &str,
|
||||
token_class_func: TokenGenerator,
|
||||
@@ -204,13 +201,13 @@ impl LexMatcher {
|
||||
quoted_value: Option<(String, RegexModeGroup)>,
|
||||
escape_replacements: Option<(String, String)>,
|
||||
casefold: Option<fn(&str) -> str>,
|
||||
fallback_lexer: Option<fn(&str, Dialect) -> Option<&str>>,
|
||||
fallback_lexer: Option<fn(&str) -> Option<&str>>,
|
||||
precheck: fn(&str) -> bool,
|
||||
kwarg_type: Option<String>,
|
||||
) -> Self {
|
||||
let pattern = format!(r"(?:{})", template);
|
||||
Self::base_regex_lexer(
|
||||
dialect,
|
||||
// dialect,
|
||||
name,
|
||||
&pattern,
|
||||
token_class_func,
|
||||
@@ -259,7 +256,7 @@ impl LexMatcher {
|
||||
.map(|mat| LexedElement::new(mat.as_str(), self))
|
||||
}
|
||||
LexerMode::Function(function) => {
|
||||
(function)(input, self.dialect).map(|s| LexedElement::new(s, self))
|
||||
(function)(input).map(|s| LexedElement::new(s, self))
|
||||
}
|
||||
};
|
||||
// println!("{},{}", self.name, t.elapsed().as_nanos());
|
||||
@@ -376,107 +373,70 @@ impl LexMatcher {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn extract_nested_block_comment(input: &str, dialect: Dialect) -> Option<&str> {
|
||||
let mut chars = input.chars().peekable();
|
||||
let mut comment = String::new();
|
||||
|
||||
// Ensure the input starts with "/*"
|
||||
if chars.next() != Some('/') || chars.next() != Some('*') {
|
||||
return None;
|
||||
}
|
||||
|
||||
comment.push_str("/*"); // Add the opening delimiter
|
||||
let mut depth = 1; // Track nesting level
|
||||
|
||||
while let Some(c) = chars.next() {
|
||||
comment.push(c);
|
||||
|
||||
if c == '/' && chars.peek() == Some(&'*') {
|
||||
chars.next(); // Consume '*'
|
||||
comment.push('*');
|
||||
depth += 1;
|
||||
} else if c == '*' && chars.peek() == Some(&'/') {
|
||||
chars.next(); // Consume '/'
|
||||
comment.push('/');
|
||||
depth -= 1;
|
||||
|
||||
if depth == 0 {
|
||||
return Some(&input[..comment.len()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we reach here, the comment wasn't properly closed
|
||||
match &dialect {
|
||||
Dialect::Sqlite => Some(&input[..comment.len()]),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: implement python passthroughs
|
||||
#[cfg(feature = "python")]
|
||||
pub mod python {}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::{dialect::Dialect, token::Token};
|
||||
// use crate::{dialect::Dialect, token::Token};
|
||||
|
||||
use super::{extract_nested_block_comment, LexMatcher};
|
||||
// use super::{LexMatcher};
|
||||
|
||||
#[test]
|
||||
fn test_subdivide() {
|
||||
let block_comment_matcher = LexMatcher::regex_lexer(
|
||||
Dialect::Ansi,
|
||||
"block_comment",
|
||||
r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
Token::comment_token_compat,
|
||||
Some(Box::new(LexMatcher::regex_subdivider(
|
||||
Dialect::Ansi,
|
||||
"newline",
|
||||
r#"\r\n|\n"#,
|
||||
Token::newline_token_compat,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
|_| true,
|
||||
None,
|
||||
))),
|
||||
Some(Box::new(LexMatcher::regex_subdivider(
|
||||
Dialect::Ansi,
|
||||
"whitespace",
|
||||
r#"[^\S\r\n]+"#,
|
||||
Token::whitespace_token_compat,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
|_| true,
|
||||
None,
|
||||
))),
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
Some(extract_nested_block_comment),
|
||||
|input| input.starts_with("/"),
|
||||
None,
|
||||
);
|
||||
// #[test]
|
||||
// fn test_subdivide() {
|
||||
// let block_comment_matcher = LexMatcher::regex_lexer(
|
||||
// // Dialect::Ansi,
|
||||
// "block_comment",
|
||||
// r#"\/\*([^\*]|\*(?!\/))*\*\/"#,
|
||||
// Token::comment_token_compat,
|
||||
// Some(Box::new(LexMatcher::regex_subdivider(
|
||||
// // Dialect::Ansi,
|
||||
// "newline",
|
||||
// r#"\r\n|\n"#,
|
||||
// Token::newline_token_compat,
|
||||
// None,
|
||||
// None,
|
||||
// None,
|
||||
// None,
|
||||
// None,
|
||||
// None,
|
||||
// None,
|
||||
// None,
|
||||
// |_| true,
|
||||
// None,
|
||||
// ))),
|
||||
// Some(Box::new(LexMatcher::regex_subdivider(
|
||||
// // Dialect::Ansi,
|
||||
// "whitespace",
|
||||
// r#"[^\S\r\n]+"#,
|
||||
// Token::whitespace_token_compat,
|
||||
// None,
|
||||
// None,
|
||||
// None,
|
||||
// None,
|
||||
// None,
|
||||
// None,
|
||||
// None,
|
||||
// None,
|
||||
// |_| true,
|
||||
// None,
|
||||
// ))),
|
||||
// None,
|
||||
// None,
|
||||
// None,
|
||||
// None,
|
||||
// None,
|
||||
// Some(extract_nested_block_comment),
|
||||
// |input| input.starts_with("/"),
|
||||
// None,
|
||||
// );
|
||||
|
||||
let (elems, _) = block_comment_matcher
|
||||
.scan_match("/*\n)\n*/")
|
||||
.expect("should match");
|
||||
for elem in elems {
|
||||
println!("{}: {}", elem.matcher.name, elem.raw);
|
||||
}
|
||||
}
|
||||
// let (elems, _) = block_comment_matcher
|
||||
// .scan_match("/*\n)\n*/")
|
||||
// .expect("should match");
|
||||
// for elem in elems {
|
||||
// println!("{}: {}", elem.matcher.name, elem.raw);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
@@ -56,6 +56,7 @@ impl Token {
|
||||
escape_replacement,
|
||||
casefold,
|
||||
raw_value,
|
||||
matching_bracket_idx: None, // Will be computed after all tokens are created
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,6 +61,11 @@ pub struct Token {
|
||||
escape_replacement: Option<(String, String)>,
|
||||
casefold: Option<fn(&str) -> str>,
|
||||
raw_value: String,
|
||||
/// Pre-computed index of matching bracket for O(1) lookup during parsing.
|
||||
/// For opening brackets like '(', '[', '{', this points to the matching closing bracket.
|
||||
/// For closing brackets like ')', ']', '}', this points back to the matching opening bracket.
|
||||
/// None for non-bracket tokens or unmatched brackets.
|
||||
pub matching_bracket_idx: Option<usize>,
|
||||
}
|
||||
|
||||
impl Token {
|
||||
@@ -211,6 +216,15 @@ impl Token {
|
||||
self.token_type.clone()
|
||||
}
|
||||
|
||||
/// Get all types for this token (instance_types + class_types)
|
||||
/// This is equivalent to Python's class_types property
|
||||
pub fn get_all_types(&self) -> hashbrown::HashSet<String> {
|
||||
let mut types = hashbrown::HashSet::new();
|
||||
types.extend(self.instance_types.iter().cloned());
|
||||
types.extend(self.class_types.iter().cloned());
|
||||
types
|
||||
}
|
||||
|
||||
pub fn is_type(&self, seg_types: &[&str]) -> bool {
|
||||
if self
|
||||
.instance_types
|
||||
@@ -584,13 +598,7 @@ impl Token {
|
||||
.segments
|
||||
.iter()
|
||||
.enumerate()
|
||||
.map(|(idx, seg)| {
|
||||
seg.copy(
|
||||
None,
|
||||
Some(Arc::new(new_segment.clone())),
|
||||
Some(idx),
|
||||
)
|
||||
})
|
||||
.map(|(idx, seg)| seg.copy(None, Some(Arc::new(new_segment.clone())), Some(idx)))
|
||||
.collect();
|
||||
}
|
||||
|
||||
@@ -690,7 +698,7 @@ impl Token {
|
||||
// }
|
||||
// }
|
||||
|
||||
// if subkeys.len() != subkeys.iter().collect::<std::collections::HashSet<_>>().len() {
|
||||
// if subkeys.len() != subkeys.iter().collect::<HashSet<_>>().len() {
|
||||
// // If there are duplicate keys, use a list of child objects.
|
||||
// result.insert(key, Some(serde_json::Value::Array(child_results)));
|
||||
// } else {
|
||||
@@ -710,121 +718,3 @@ impl Token {
|
||||
// result
|
||||
// }
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::matcher::TokenGenerator;
|
||||
use crate::slice::Slice;
|
||||
use crate::templater::templatefile::TemplatedFile;
|
||||
|
||||
use super::*;
|
||||
|
||||
/// Roughly generate test segments.
|
||||
///
|
||||
/// This function isn't totally robust, but good enough
|
||||
/// for testing. Use with caution.
|
||||
fn generate_test_segments(elems: &[&str]) -> Vec<Token> {
|
||||
let mut buff = vec![];
|
||||
let templated_file = Arc::new(TemplatedFile::from(
|
||||
elems.iter().cloned().collect::<String>(),
|
||||
));
|
||||
let mut idx = 0;
|
||||
|
||||
for elem in elems {
|
||||
let elem = &**elem;
|
||||
if elem == "<indent>" {
|
||||
buff.push(Token::indent_token(
|
||||
PositionMarker::from_point(idx, idx, &templated_file, None, None),
|
||||
false,
|
||||
None,
|
||||
HashSet::new(),
|
||||
));
|
||||
continue;
|
||||
} else if elem == "<dedent>" {
|
||||
buff.push(Token::dedent_token(
|
||||
PositionMarker::from_point(idx, idx, &templated_file, None, None),
|
||||
false,
|
||||
None,
|
||||
HashSet::new(),
|
||||
));
|
||||
continue;
|
||||
}
|
||||
let (token_fn, instance_types): (TokenGenerator, Vec<String>) =
|
||||
match elem {
|
||||
" " | "\t" => (
|
||||
Token::whitespace_token_compat,
|
||||
Vec::new(),
|
||||
),
|
||||
"\n" => (Token::newline_token_compat, Vec::new()),
|
||||
"(" => (
|
||||
Token::symbol_token_compat,
|
||||
Vec::from_iter(["start_bracket".to_string()]),
|
||||
),
|
||||
")" => (
|
||||
Token::symbol_token_compat,
|
||||
Vec::from_iter(["end_bracket".to_string()]),
|
||||
),
|
||||
"[" => (
|
||||
Token::symbol_token_compat,
|
||||
Vec::from_iter(["start_square_bracket".to_string()]),
|
||||
),
|
||||
"]" => (
|
||||
Token::symbol_token_compat,
|
||||
Vec::from_iter(["end_square_bracket".to_string()]),
|
||||
),
|
||||
s if s.starts_with("--") => (
|
||||
Token::comment_token_compat,
|
||||
Vec::from_iter(["inline_comment".to_string()]),
|
||||
),
|
||||
s if s.starts_with("\"") => (
|
||||
Token::code_token_compat,
|
||||
Vec::from_iter(["double_quote".to_string()]),
|
||||
),
|
||||
s if s.starts_with("'") => (
|
||||
Token::code_token_compat,
|
||||
Vec::from_iter(["single_quote".to_string()]),
|
||||
),
|
||||
_ => (Token::code_token_compat, Vec::new()),
|
||||
};
|
||||
|
||||
buff.push(token_fn(
|
||||
elem.into(),
|
||||
PositionMarker::new(
|
||||
Slice {
|
||||
start: idx,
|
||||
stop: idx + elem.len(),
|
||||
},
|
||||
Slice {
|
||||
start: idx,
|
||||
stop: idx + elem.len(),
|
||||
},
|
||||
&templated_file,
|
||||
None,
|
||||
None,
|
||||
),
|
||||
HashSet::new(),
|
||||
instance_types,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
));
|
||||
idx += elem.len();
|
||||
}
|
||||
|
||||
buff
|
||||
}
|
||||
|
||||
fn raw_segments() -> Vec<Token> {
|
||||
generate_test_segments(&["foobar", ".barfoo"])
|
||||
}
|
||||
|
||||
#[test]
|
||||
/// Test niche case of calling get_raw_segments on a raw segment.
|
||||
fn test_parser_raw_get_raw_segments() {
|
||||
for s in raw_segments() {
|
||||
assert_eq!(s.raw_segments(), [s]);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,14 +1,2 @@
|
||||
pub mod config;
|
||||
pub mod dialect;
|
||||
pub mod lexer;
|
||||
pub mod marker;
|
||||
pub mod matcher;
|
||||
#[cfg(feature = "python")]
|
||||
pub mod python;
|
||||
pub mod regex;
|
||||
pub mod slice;
|
||||
pub mod templater;
|
||||
pub mod token;
|
||||
// include!(concat!(env!("OUT_DIR"), "/dialect_matcher.rs"));
|
||||
|
||||
use crate::dialect::Dialect;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use crate::lexer::python::{PyLexer, PySQLLexError};
|
||||
use crate::marker::python::PyPositionMarker;
|
||||
use crate::templater::{
|
||||
use pyo3::prelude::*;
|
||||
use sqlfluffrs_lexer::{PyLexer, PySQLLexError};
|
||||
use sqlfluffrs_types::templater::{
|
||||
fileslice::python::{PyRawFileSlice, PyTemplatedFileSlice},
|
||||
templatefile::python::PyTemplatedFile,
|
||||
};
|
||||
use crate::token::python::PyToken;
|
||||
use pyo3::prelude::*;
|
||||
use sqlfluffrs_types::PyPositionMarker;
|
||||
use sqlfluffrs_types::PyToken;
|
||||
|
||||
/// A Python module implemented in Rust.
|
||||
#[pymodule(name = "sqlfluffrs", module = "sqlfluffrs")]
|
||||
|
||||
@@ -15,7 +15,7 @@ def generate_use():
|
||||
f"{dialect.label.upper()}_LEXERS}};"
|
||||
)
|
||||
print()
|
||||
print("use crate::matcher::LexMatcher;")
|
||||
print("use sqlfluffrs_types::LexMatcher;")
|
||||
print("use std::str::FromStr;")
|
||||
|
||||
|
||||
|
||||
@@ -12,12 +12,8 @@ from sqlfluff.core.parser.lexer import LexerType
|
||||
def generate_use():
|
||||
"""Generates the `use` statements."""
|
||||
print("use once_cell::sync::Lazy;")
|
||||
print("use crate::matcher::{LexMatcher, extract_nested_block_comment};")
|
||||
print("use crate::token::Token;")
|
||||
print("use crate::token::config::TokenConfig;")
|
||||
print("use crate::regex::RegexModeGroup;")
|
||||
print("use crate::dialect::Dialect;")
|
||||
print("use hashbrown::HashSet;")
|
||||
print("use sqlfluffrs_types::LexMatcher;")
|
||||
print("use sqlfluffrs_types::{Token, TokenConfig, RegexModeGroup};")
|
||||
|
||||
|
||||
def segment_to_token_name(s: str):
|
||||
@@ -188,7 +184,6 @@ def _as_rust_lexer_matcher(lexer_matcher: LexerType, dialect: str, is_subdivide=
|
||||
|
||||
return f"""
|
||||
LexMatcher::{rust_fn}(
|
||||
Dialect::{dialect},
|
||||
"{lexer_matcher.name}",
|
||||
{template},{token_closure},
|
||||
{subdivider},
|
||||
@@ -222,6 +217,21 @@ def _generate_token_closure(
|
||||
}}"""
|
||||
|
||||
|
||||
def generate_extract_nested_block_comments(dialect: str):
|
||||
"""This function handles nested block comments.
|
||||
|
||||
Since this function is now shared across all dialects, we just need
|
||||
to generate a wrapper that passes the dialect name to the shared implementation.
|
||||
"""
|
||||
print(
|
||||
f"""
|
||||
// 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, "{dialect}")
|
||||
}}"""
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Build generated Rust output for a dialect."
|
||||
@@ -237,3 +247,5 @@ if __name__ == "__main__":
|
||||
generate_reserved_keyword_list(args.dialect)
|
||||
print()
|
||||
generate_lexer(args.dialect)
|
||||
print()
|
||||
generate_extract_nested_block_comments(args.dialect)
|
||||
|
||||
@@ -44,18 +44,24 @@ if __name__ == "__main__":
|
||||
dialects_list = [
|
||||
(
|
||||
f"utils/{builder}.py",
|
||||
f"sqlfluffrs/src/dialect/{dialect.label.lower()}/{file}.rs",
|
||||
"sqlfluffrs/sqlfluffrs_dialects/src/dialect/"
|
||||
f"{dialect.label.lower()}/{file}.rs",
|
||||
args,
|
||||
)
|
||||
for dialect in dialect_readout()
|
||||
for builder, file, args in [
|
||||
("build_dialect", "mod", []),
|
||||
("build_lexers", "matcher", [dialect.label.lower()]),
|
||||
# ("build_parsers", "parser", [dialect.label.lower()]),
|
||||
]
|
||||
]
|
||||
|
||||
file_pair_list = [
|
||||
("utils/build_dialects.py", "sqlfluffrs/src/dialect/mod.rs", []),
|
||||
(
|
||||
"utils/build_dialects.py",
|
||||
"sqlfluffrs/sqlfluffrs_dialects/src/dialect/mod.rs",
|
||||
[],
|
||||
),
|
||||
*dialects_list,
|
||||
]
|
||||
parser = argparse.ArgumentParser(
|
||||
|
||||
Reference in New Issue
Block a user