chore: add new snapshots and fix errors introduced from ast changes

This commit is contained in:
rvcas 2025-03-23 23:14:33 -04:00
parent e5211cf792
commit abcbe48267
No known key found for this signature in database
GPG Key ID: C09B64E263F7D68C
15 changed files with 295 additions and 75 deletions

View File

@ -5,9 +5,18 @@ description: "Code:\n\n#\"00aaff\""
ByteArray { ByteArray {
location: 0..9, location: 0..9,
bytes: [ bytes: [
0, (
170, 0,
255, 0..0,
),
(
170,
0..0,
),
(
255,
0..0,
),
], ],
preferred_format: HexadecimalString, preferred_format: HexadecimalString,
} }

View File

@ -5,9 +5,18 @@ description: "Code:\n\n#[0, 170, 255]"
ByteArray { ByteArray {
location: 0..14, location: 0..14,
bytes: [ bytes: [
0, (
170, 0,
255, 2..3,
),
(
170,
5..8,
),
(
255,
10..13,
),
], ],
preferred_format: ArrayOfBytes( preferred_format: ArrayOfBytes(
Decimal { Decimal {

View File

@ -5,11 +5,26 @@ description: "Code:\n\n\"aiken\""
ByteArray { ByteArray {
location: 0..7, location: 0..7,
bytes: [ bytes: [
97, (
105, 97,
107, 0..0,
101, ),
110, (
105,
0..0,
),
(
107,
0..0,
),
(
101,
0..0,
),
(
110,
0..0,
),
], ],
preferred_format: Utf8String, preferred_format: Utf8String,
} }

View File

@ -5,13 +5,34 @@ description: "Code:\n\n\"\\\"aiken\\\"\""
ByteArray { ByteArray {
location: 0..11, location: 0..11,
bytes: [ bytes: [
34, (
97, 34,
105, 0..0,
107, ),
101, (
110, 97,
34, 0..0,
),
(
105,
0..0,
),
(
107,
0..0,
),
(
101,
0..0,
),
(
110,
0..0,
),
(
34,
0..0,
),
], ],
preferred_format: Utf8String, preferred_format: Utf8String,
} }

View File

@ -12,11 +12,26 @@ Call {
value: ByteArray { value: ByteArray {
location: 13..20, location: 13..20,
bytes: [ bytes: [
65, (
105, 65,
107, 0..0,
101, ),
110, (
105,
0..0,
),
(
107,
0..0,
),
(
101,
0..0,
),
(
110,
0..0,
),
], ],
preferred_format: Utf8String, preferred_format: Utf8String,
}, },

View File

@ -12,11 +12,26 @@ Call {
value: ByteArray { value: ByteArray {
location: 25..32, location: 25..32,
bytes: [ bytes: [
65, (
105, 65,
107, 0..0,
101, ),
110, (
105,
0..0,
),
(
107,
0..0,
),
(
101,
0..0,
),
(
110,
0..0,
),
], ],
preferred_format: Utf8String, preferred_format: Utf8String,
}, },

View File

@ -22,11 +22,26 @@ RecordUpdate {
value: ByteArray { value: ByteArray {
location: 21..28, location: 21..28,
bytes: [ bytes: [
65, (
105, 65,
107, 0..0,
101, ),
110, (
105,
0..0,
),
(
107,
0..0,
),
(
101,
0..0,
),
(
110,
0..0,
),
], ],
preferred_format: Utf8String, preferred_format: Utf8String,
}, },

View File

@ -19,18 +19,36 @@ Trace {
ByteArray { ByteArray {
location: 18..23, location: 18..23,
bytes: [ bytes: [
102, (
111, 102,
111, 0..0,
),
(
111,
0..0,
),
(
111,
0..0,
),
], ],
preferred_format: Utf8String, preferred_format: Utf8String,
}, },
ByteArray { ByteArray {
location: 25..30, location: 25..30,
bytes: [ bytes: [
98, (
97, 98,
114, 0..0,
),
(
97,
0..0,
),
(
114,
0..0,
),
], ],
preferred_format: Utf8String, preferred_format: Utf8String,
}, },

View File

@ -20,18 +20,36 @@ Trace {
ByteArray { ByteArray {
location: 19..24, location: 19..24,
bytes: [ bytes: [
102, (
111, 102,
111, 0..0,
),
(
111,
0..0,
),
(
111,
0..0,
),
], ],
preferred_format: Utf8String, preferred_format: Utf8String,
}, },
ByteArray { ByteArray {
location: 26..31, location: 26..31,
bytes: [ bytes: [
98, (
97, 98,
114, 0..0,
),
(
97,
0..0,
),
(
114,
0..0,
),
], ],
preferred_format: Utf8String, preferred_format: Utf8String,
}, },

View File

@ -15,9 +15,18 @@ When {
ByteArray { ByteArray {
location: 18..27, location: 18..27,
value: [ value: [
0, (
171, 0,
205, 0..0,
),
(
171,
0..0,
),
(
205,
0..0,
),
], ],
preferred_format: HexadecimalString, preferred_format: HexadecimalString,
}, },
@ -33,19 +42,58 @@ When {
ByteArray { ByteArray {
location: 40..55, location: 40..55,
value: [ value: [
65, (
105, 65,
107, 0..0,
101, ),
110, (
44, 105,
32, 0..0,
114, ),
111, (
99, 107,
107, 0..0,
115, ),
33, (
101,
0..0,
),
(
110,
0..0,
),
(
44,
0..0,
),
(
32,
0..0,
),
(
114,
0..0,
),
(
111,
0..0,
),
(
99,
0..0,
),
(
107,
0..0,
),
(
115,
0..0,
),
(
33,
0..0,
),
], ],
preferred_format: Utf8String, preferred_format: Utf8String,
}, },
@ -61,10 +109,22 @@ When {
ByteArray { ByteArray {
location: 68..81, location: 68..81,
value: [ value: [
1, (
2, 1,
3, 70..71,
4, ),
(
2,
73..74,
),
(
3,
76..77,
),
(
4,
79..80,
),
], ],
preferred_format: ArrayOfBytes( preferred_format: ArrayOfBytes(
Decimal { Decimal {
@ -84,9 +144,18 @@ When {
ByteArray { ByteArray {
location: 94..113, location: 94..113,
value: [ value: [
0, (
171, 0,
205, 96..100,
),
(
171,
102..106,
),
(
205,
108..112,
),
], ],
preferred_format: ArrayOfBytes( preferred_format: ArrayOfBytes(
Hexadecimal, Hexadecimal,

View File

@ -18,9 +18,18 @@ Module {
value: ByteArray { value: ByteArray {
location: 21..26, location: 21..26,
bytes: [ bytes: [
226, (
152, 226,
133, 0..0,
),
(
152,
0..0,
),
(
133,
0..0,
),
], ],
preferred_format: Utf8String, preferred_format: Utf8String,
}, },

View File

@ -18,7 +18,10 @@ Module {
value: ByteArray { value: ByteArray {
location: 21..24, location: 21..24,
bytes: [ bytes: [
42, (
42,
0..0,
),
], ],
preferred_format: Utf8String, preferred_format: Utf8String,
}, },

View File

@ -555,7 +555,11 @@ impl<'a, 'b> ExprTyper<'a, 'b> {
bytes, bytes,
preferred_format, preferred_format,
location, location,
} => self.infer_bytearray(bytes, preferred_format, location), } => self.infer_bytearray(
bytes.into_iter().map(|(b, _)| b).collect(),
preferred_format,
location,
),
UntypedExpr::CurvePoint { UntypedExpr::CurvePoint {
location, location,

View File

@ -210,7 +210,7 @@ impl<'a, 'b> PatternTyper<'a, 'b> {
Ok(Pattern::ByteArray { Ok(Pattern::ByteArray {
location, location,
value, value: value.into_iter().map(|(b, _)| b).collect(),
preferred_format, preferred_format,
}) })
} }

View File

@ -126,7 +126,7 @@ impl SimpleExpr {
}, },
SimpleExpr::ByteArray(bs, preferred_format) => UntypedExpr::ByteArray { SimpleExpr::ByteArray(bs, preferred_format) => UntypedExpr::ByteArray {
location: Span::empty(), location: Span::empty(),
bytes: bs.to_vec(), bytes: bs.iter().map(|b| (*b, Span::empty())).collect(),
preferred_format: *preferred_format, preferred_format: *preferred_format,
}, },
SimpleExpr::List(es) => match annotation { SimpleExpr::List(es) => match annotation {