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
---
source: crates/vicuna-compiler/src/parser.rs
expression: "statement().repeated().parse(\"let a = if b { 10 } else { 20 }\n 10 + 11;\n let h = foobar;\")"
---
Ok:
- - Let:
- - a
- start: 3
end: 6
- - If:
condition:
- Variable: b
- start: 11
end: 13
then_block:
- stmts: []
end_expr:
- Value:
I32: 10
- start: 15
end: 17
- start: 13
end: 20
else_block:
- stmts: []
end_expr:
- Value:
I32: 20
- start: 27
end: 29
- start: 24
end: 44
- start: 7
end: 44
- start: 0
end: 44
- - Expr:
- Binary:
- - Add
- start: 47
end: 49
- - Value:
I32: 10
- start: 44
end: 46
- - Value:
I32: 11
- start: 49
end: 51
- start: 44
end: 51
- start: 44
end: 52
- - Let:
- - h
- start: 68
end: 71
- - Variable: foobar
- start: 73
end: 79
- start: 65
end: 80