1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
source: crates/aiken-lang/src/parser/expr/if_else.rs
description: "Code:\n\nif True {\n 1 + 1\n} else if a < 1 {\n 3\n} else {\n 4\n}\n"
---
If {
location: 0..54,
branches: [
IfBranch {
condition: Var {
location: 3..7,
name: "True",
},
body: BinOp {
location: 12..17,
name: AddInt,
left: UInt {
location: 12..13,
value: "1",
base: Decimal {
numeric_underscore: false,
},
},
right: UInt {
location: 16..17,
value: "1",
base: Decimal {
numeric_underscore: false,
},
},
},
location: 3..19,
},
IfBranch {
condition: BinOp {
location: 28..33,
name: LtInt,
left: Var {
location: 28..29,
name: "a",
},
right: UInt {
location: 32..33,
value: "1",
base: Decimal {
numeric_underscore: false,
},
},
},
body: UInt {
location: 38..39,
value: "3",
base: Decimal {
numeric_underscore: false,
},
},
location: 28..41,
},
],
final_else: UInt {
location: 51..52,
value: "4",
base: Decimal {
numeric_underscore: false,
},
},
}