File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -984,7 +984,7 @@ impl<'a> Tokenizer<'a> {
984984 }
985985 '{' => self . consume_and_return ( chars, Token :: LBrace ) ,
986986 '}' => self . consume_and_return ( chars, Token :: RBrace ) ,
987- '#' if dialect_of ! ( self is SnowflakeDialect ) => {
987+ '#' if dialect_of ! ( self is SnowflakeDialect | BigQueryDialect ) => {
988988 chars. next ( ) ; // consume the '#', starting a snowflake single-line comment
989989 let comment = self . tokenize_single_line_comment ( chars) ;
990990 Ok ( Some ( Token :: Whitespace ( Whitespace :: SingleLineComment {
Original file line number Diff line number Diff line change @@ -8607,6 +8607,24 @@ fn test_release_savepoint() {
86078607 one_statement_parses_to ( "RELEASE test1" , "RELEASE SAVEPOINT test1" ) ;
86088608}
86098609
8610+ #[ test]
8611+ fn test_comment_hash_syntax ( ) {
8612+ let dialects = TestedDialects {
8613+ dialects : vec ! [ Box :: new( BigQueryDialect { } ) , Box :: new( SnowflakeDialect { } ) ] ,
8614+ options : None ,
8615+ } ;
8616+ let sql = r#"
8617+ # comment
8618+ SELECT a, b, c # , d, e
8619+ FROM T
8620+ ####### comment #################
8621+ WHERE true
8622+ # comment
8623+ "# ;
8624+ let canonical = "SELECT a, b, c FROM T WHERE true" ;
8625+ dialects. verified_only_select_with_canonical ( sql, canonical) ;
8626+ }
8627+
86108628#[ test]
86118629fn test_buffer_reuse ( ) {
86128630 let d = GenericDialect { } ;
You can’t perform that action at this time.
0 commit comments