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 {
location: 0..9,
bytes: [
0,
170,
255,
(
0,
0..0,
),
(
170,
0..0,
),
(
255,
0..0,
),
],
preferred_format: HexadecimalString,
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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