@@ -42,6 +42,12 @@ pub enum Value {
42
42
SingleQuotedString ( String ) ,
43
43
// $<tag_name>$string value$<tag_name>$ (postgres syntax)
44
44
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 ) ,
45
51
/// e'string value' (postgres extension)
46
52
/// See [Postgres docs](https://www.postgresql.org/docs/8.3/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS)
47
53
/// for more details.
@@ -50,9 +56,24 @@ pub enum Value {
50
56
SingleQuotedByteStringLiteral ( String ) ,
51
57
/// B"string value"
52
58
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 ) ,
56
77
/// N'string value'
57
78
NationalStringLiteral ( String ) ,
58
79
/// X'hex value'
@@ -73,14 +94,25 @@ impl fmt::Display for Value {
73
94
Value :: Number ( v, l) => write ! ( f, "{}{long}" , v, long = if * l { "L" } else { "" } ) ,
74
95
Value :: DoubleQuotedString ( v) => write ! ( f, "\" {}\" " , escape_double_quote_string( v) ) ,
75
96
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
+ }
76
103
Value :: DollarQuotedString ( v) => write ! ( f, "{v}" ) ,
77
104
Value :: EscapedStringLiteral ( v) => write ! ( f, "E'{}'" , escape_escaped_string( v) ) ,
78
105
Value :: NationalStringLiteral ( v) => write ! ( f, "N'{v}'" ) ,
79
106
Value :: HexStringLiteral ( v) => write ! ( f, "X'{v}'" ) ,
80
107
Value :: Boolean ( v) => write ! ( f, "{v}" ) ,
81
108
Value :: SingleQuotedByteStringLiteral ( v) => write ! ( f, "B'{v}'" ) ,
82
109
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}""""# ) ,
84
116
Value :: Null => write ! ( f, "NULL" ) ,
85
117
Value :: Placeholder ( v) => write ! ( f, "{v}" ) ,
86
118
}
0 commit comments