@@ -44,6 +44,10 @@ pub enum Token {
4444 /// This should retains the escaped character sequences so that
4545 /// .to_string() of the value will give the value that was in the input
4646 SingleQuotedString ( String ) ,
47+ /// Double quoted string: i.e: "string"
48+ /// This should retains the escaped character sequences so that
49+ /// .to_string() of the value will give the value that was in the input
50+ DoubleQuotedString ( String ) ,
4751 /// Single quoted string: i.e: 'string'
4852 BacktickQuotedString ( String ) ,
4953 BqRegexQuotedString {
@@ -165,6 +169,7 @@ impl fmt::Display for Token {
165169 Token :: Number ( ref n) => f. write_str ( n) ,
166170 Token :: Char ( ref c) => write ! ( f, "{}" , c) ,
167171 Token :: SingleQuotedString ( ref s) => write ! ( f, "'{}'" , s) ,
172+ Token :: DoubleQuotedString ( ref s) => write ! ( f, "\" {}\" " , s) ,
168173 Token :: BacktickQuotedString ( ref s) => write ! ( f, "`{}`" , s) ,
169174 Token :: NationalStringLiteral ( ref s) => write ! ( f, "N'{}'" , s) ,
170175 Token :: BqRegexQuotedString { ref value, quote } => {
@@ -353,6 +358,7 @@ impl<'a> Tokenizer<'a> {
353358 Token :: Word ( w) if w. quote_style != None => self . col += w. value . len ( ) as u64 + 2 ,
354359 Token :: Number ( s) => self . col += s. len ( ) as u64 ,
355360 Token :: SingleQuotedString ( s) => self . col += s. len ( ) as u64 ,
361+ Token :: DoubleQuotedString ( s) => self . col += s. len ( ) as u64 ,
356362 Token :: BacktickQuotedString ( s) => self . col += s. len ( ) as u64 ,
357363 _ => self . col += 1 ,
358364 }
@@ -443,6 +449,11 @@ impl<'a> Tokenizer<'a> {
443449 Ok ( Some ( Token :: SingleQuotedString ( s) ) )
444450 }
445451 // string
452+ '"' if dialect_of ! ( self is BigQueryDialect ) => {
453+ let s = self . tokenize_double_quoted_string ( chars) ?;
454+ Ok ( Some ( Token :: DoubleQuotedString ( s) ) )
455+ }
456+ // string
446457 '`' if dialect_of ! ( self is BigQueryDialect ) => {
447458 chars. next ( ) ; // consume opening backtick
448459 let s = peeking_take_while ( chars, |ch| ch != '`' ) ;
0 commit comments