File tree Expand file tree Collapse file tree 2 files changed +25
-18
lines changed Expand file tree Collapse file tree 2 files changed +25
-18
lines changed Original file line number Diff line number Diff line change @@ -79,9 +79,7 @@ impl Dialect for SnowflakeDialect {
79
79
}
80
80
81
81
// See https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#escape_sequences
82
- fn supports_string_literal_backslash_escape ( & self ) -> bool {
83
- false
84
- }
82
+ fn supports_string_literal_backslash_escape ( & self ) -> bool { true }
85
83
86
84
fn supports_within_after_array_aggregation ( & self ) -> bool {
87
85
true
Original file line number Diff line number Diff line change @@ -2004,21 +2004,21 @@ impl<'a> Tokenizer<'a> {
2004
2004
return Ok ( s) ;
2005
2005
}
2006
2006
}
2007
- char if dialect_of ! ( self is SnowflakeDialect ) && char. is_ascii_control ( ) => {
2008
- // let n = match char {
2009
- // '\x00' => '\0',
2010
- // '\x07' => '\u{7}',
2011
- // '\x08' => '\u{8}',
2012
- // '\x12' => '\u{c}',
2013
- // '\x10' => '\n',
2014
- // '\x13' => '\r',
2015
- // '\x09' => '\t',
2016
- // '\x26' => '\u{1a}',
2017
- // _ => char,
2018
- // };
2019
- s. push ( '\0' ) ;
2020
- chars. next ( ) ; // consume symbol
2021
- }
2007
+ // char if dialect_of!(self is SnowflakeDialect) && char.is_ascii_control() => {
2008
+ // let n = match char {
2009
+ // '\x00' => '\0',
2010
+ // '\x07' => '\u{7}',
2011
+ // '\x08' => '\u{8}',
2012
+ // '\x12' => '\u{c}',
2013
+ // '\x10' => '\n',
2014
+ // '\x13' => '\r',
2015
+ // '\x09' => '\t',
2016
+ // '\x26' => '\u{1a}',
2017
+ // _ => char,
2018
+ // };
2019
+ // s.push('\0');
2020
+ // chars.next(); // consume symbol
2021
+ // }
2022
2022
'\\' if settings. backslash_escape => {
2023
2023
// consume backslash
2024
2024
chars. next ( ) ;
@@ -2031,6 +2031,15 @@ impl<'a> Tokenizer<'a> {
2031
2031
s. push ( ch) ;
2032
2032
s. push ( * next) ;
2033
2033
chars. next ( ) ; // consume next
2034
+ //if [\\]\\b -> [\\]b
2035
+ } else if dialect_of ! ( self is SnowflakeDialect ) && * next == '\\' {
2036
+ s. push ( * next) ;
2037
+ chars. next ( ) ;
2038
+ //if [\\]b -> \\[b]
2039
+ if let Some ( next) = chars. peek ( ) {
2040
+ s. push ( * next) ;
2041
+ chars. next ( ) ;
2042
+ }
2034
2043
} else {
2035
2044
let n = match next {
2036
2045
'0' => '\0' ,
You can’t perform that action at this time.
0 commit comments