@@ -42,6 +42,12 @@ pub enum Value {
4242 SingleQuotedString ( String ) ,
4343 // $<tag_name>$string value$<tag_name>$ (postgres syntax)
4444 DollarQuotedString ( DollarQuotedString ) ,
45+ /// Triple single quoted strings: Example '''abc'''
46+ /// [BigQuery](https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#quoted_literals)
47+ TripleSingleQuotedString ( String ) ,
48+ /// Triple double quoted strings: Example """abc"""
49+ /// [BigQuery](https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#quoted_literals)
50+ TripleDoubleQuotedString ( String ) ,
4551 /// e'string value' (postgres extension)
4652 /// See [Postgres docs](https://www.postgresql.org/docs/8.3/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS)
4753 /// for more details.
@@ -50,9 +56,24 @@ pub enum Value {
5056 SingleQuotedByteStringLiteral ( String ) ,
5157 /// B"string value"
5258 DoubleQuotedByteStringLiteral ( String ) ,
53- /// R'string value' or r'string value' or r"string value"
54- /// <https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#quoted_literals>
55- RawStringLiteral ( String ) ,
59+ /// Triple single quoted literal with byte string prefix. Example `B'''abc'''`
60+ /// [BigQuery](https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#quoted_literals)
61+ TripleSingleQuotedByteStringLiteral ( String ) ,
62+ /// Triple double quoted literal with byte string prefix. Example `B"""abc"""`
63+ /// [BigQuery](https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#quoted_literals)
64+ TripleDoubleQuotedByteStringLiteral ( String ) ,
65+ /// Single quoted literal with raw string prefix. Example `R'abc'`
66+ /// [BigQuery](https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#quoted_literals)
67+ SingleQuotedRawStringLiteral ( String ) ,
68+ /// Double quoted literal with raw string prefix. Example `R"abc"`
69+ /// [BigQuery](https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#quoted_literals)
70+ DoubleQuotedRawStringLiteral ( String ) ,
71+ /// Triple single quoted literal with raw string prefix. Example `R'''abc'''`
72+ /// [BigQuery](https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#quoted_literals)
73+ TripleSingleQuotedRawStringLiteral ( String ) ,
74+ /// Triple double quoted literal with raw string prefix. Example `R"""abc"""`
75+ /// [BigQuery](https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#quoted_literals)
76+ TripleDoubleQuotedRawStringLiteral ( String ) ,
5677 /// N'string value'
5778 NationalStringLiteral ( String ) ,
5879 /// X'hex value'
@@ -73,14 +94,25 @@ impl fmt::Display for Value {
7394 Value :: Number ( v, l) => write ! ( f, "{}{long}" , v, long = if * l { "L" } else { "" } ) ,
7495 Value :: DoubleQuotedString ( v) => write ! ( f, "\" {}\" " , escape_double_quote_string( v) ) ,
7596 Value :: SingleQuotedString ( v) => write ! ( f, "'{}'" , escape_single_quote_string( v) ) ,
97+ Value :: TripleSingleQuotedString ( v) => {
98+ write ! ( f, "'''{v}'''" )
99+ }
100+ Value :: TripleDoubleQuotedString ( v) => {
101+ write ! ( f, r#""""{v}""""# )
102+ }
76103 Value :: DollarQuotedString ( v) => write ! ( f, "{v}" ) ,
77104 Value :: EscapedStringLiteral ( v) => write ! ( f, "E'{}'" , escape_escaped_string( v) ) ,
78105 Value :: NationalStringLiteral ( v) => write ! ( f, "N'{v}'" ) ,
79106 Value :: HexStringLiteral ( v) => write ! ( f, "X'{v}'" ) ,
80107 Value :: Boolean ( v) => write ! ( f, "{v}" ) ,
81108 Value :: SingleQuotedByteStringLiteral ( v) => write ! ( f, "B'{v}'" ) ,
82109 Value :: DoubleQuotedByteStringLiteral ( v) => write ! ( f, "B\" {v}\" " ) ,
83- Value :: RawStringLiteral ( v) => write ! ( f, "R'{v}'" ) ,
110+ Value :: TripleSingleQuotedByteStringLiteral ( v) => write ! ( f, "B'''{v}'''" ) ,
111+ Value :: TripleDoubleQuotedByteStringLiteral ( v) => write ! ( f, r#"B"""{v}""""# ) ,
112+ Value :: SingleQuotedRawStringLiteral ( v) => write ! ( f, "R'{v}'" ) ,
113+ Value :: DoubleQuotedRawStringLiteral ( v) => write ! ( f, "R\" {v}\" " ) ,
114+ Value :: TripleSingleQuotedRawStringLiteral ( v) => write ! ( f, "R'''{v}'''" ) ,
115+ Value :: TripleDoubleQuotedRawStringLiteral ( v) => write ! ( f, r#"R"""{v}""""# ) ,
84116 Value :: Null => write ! ( f, "NULL" ) ,
85117 Value :: Placeholder ( v) => write ! ( f, "{v}" ) ,
86118 }
0 commit comments