mirror of
https://github.com/apple/pkl.git
synced 2026-05-25 16:19:20 +02:00
Switch yaml.Parser to parse binary scalars as Bytes (#1277)
This commit is contained in:
+10
-2
@@ -109,9 +109,16 @@ examples {
|
||||
parser.parse("!!timestamp 2001-12-15T02:59:43.1Z")
|
||||
}
|
||||
|
||||
// parsed as string because Pkl doesn't have a binary type
|
||||
["binary"] {
|
||||
parser.parse("!!binary dGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw==")
|
||||
parser.parse("!!binary AQID")
|
||||
parser.parse("!!binary 'AQID'")
|
||||
parser.parse("!!binary \"AQID\"")
|
||||
parser.parse("""
|
||||
!!binary |-
|
||||
AQID
|
||||
AQID
|
||||
AQID
|
||||
""")
|
||||
}
|
||||
|
||||
["string"] {
|
||||
@@ -195,6 +202,7 @@ examples {
|
||||
price : 2392.00
|
||||
tax : 251.42
|
||||
total: 4443.52
|
||||
logo: !!binary AQID
|
||||
comments: >
|
||||
Late afternoon is best.
|
||||
Backup contact is Nancy
|
||||
|
||||
+5
-1
@@ -97,7 +97,10 @@ examples {
|
||||
"2001-12-15T02:59:43.1Z"
|
||||
}
|
||||
["binary"] {
|
||||
"dGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw=="
|
||||
Bytes(1, 2, 3)
|
||||
Bytes(1, 2, 3)
|
||||
Bytes(1, 2, 3)
|
||||
Bytes(1, 2, 3, 1, 2, 3, 1, 2, 3)
|
||||
}
|
||||
["string"] {
|
||||
null
|
||||
@@ -190,6 +193,7 @@ examples {
|
||||
}
|
||||
tax = 251.42
|
||||
total = 4443.52
|
||||
logo = Bytes(1, 2, 3)
|
||||
comments = "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338."
|
||||
}
|
||||
}
|
||||
|
||||
+5
-1
@@ -97,7 +97,10 @@ examples {
|
||||
"2001-12-15T02:59:43.1Z"
|
||||
}
|
||||
["binary"] {
|
||||
"dGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw=="
|
||||
Bytes(1, 2, 3)
|
||||
Bytes(1, 2, 3)
|
||||
Bytes(1, 2, 3)
|
||||
Bytes(1, 2, 3, 1, 2, 3, 1, 2, 3)
|
||||
}
|
||||
["string"] {
|
||||
null
|
||||
@@ -190,6 +193,7 @@ examples {
|
||||
}
|
||||
tax = 251.42
|
||||
total = 4443.52
|
||||
logo = Bytes(1, 2, 3)
|
||||
comments = "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338."
|
||||
}
|
||||
}
|
||||
|
||||
+5
-1
@@ -97,7 +97,10 @@ examples {
|
||||
"2001-12-15T02:59:43.1Z"
|
||||
}
|
||||
["binary"] {
|
||||
"dGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw=="
|
||||
Bytes(1, 2, 3)
|
||||
Bytes(1, 2, 3)
|
||||
Bytes(1, 2, 3)
|
||||
Bytes(1, 2, 3, 1, 2, 3, 1, 2, 3)
|
||||
}
|
||||
["string"] {
|
||||
null
|
||||
@@ -190,6 +193,7 @@ examples {
|
||||
}
|
||||
tax = 251.42
|
||||
total = 4443.52
|
||||
logo = Bytes(1, 2, 3)
|
||||
comments = "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338."
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user