diff options
author | Bad Diode <bd@badd10de.dev> | 2024-06-24 15:03:27 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2024-06-24 15:03:27 +0200 |
commit | c9d686a1a6f49f8c8c4aa698c14448d961a0f024 (patch) | |
tree | 57a7a94b1dd39b2d5158ff9e81e1e72bc7e80525 /tests | |
parent | 6fbe06eda046bd3b261e2ba84e1f728ecdf55a47 (diff) | |
download | bdl-c9d686a1a6f49f8c8c4aa698c14448d961a0f024.tar.gz bdl-c9d686a1a6f49f8c8c4aa698c14448d961a0f024.zip |
Add more graph viz for function maps and types
Diffstat (limited to 'tests')
-rw-r--r-- | tests/semantics.bad | 56 |
1 files changed, 31 insertions, 25 deletions
diff --git a/tests/semantics.bad b/tests/semantics.bad index 518ef40..3305222 100644 --- a/tests/semantics.bad +++ b/tests/semantics.bad | |||
@@ -1,22 +1,22 @@ | |||
1 | ; let a:f32 = (1.0 + 2.0 * 2.0) / 2.0 | 1 | ; let a:f32 = (1.0 + 2.0 * 2.0) / 2.0 |
2 | 2 | ||
3 | ; let annotated:int = (1 + 2 * 2) / 2 | 3 | let annotated:int = (1 + 2 * 2) / 2 |
4 | ; let numbers = 1 | 4 | let numbers = 1 |
5 | ; let symbols = numbers | 5 | let symbols = numbers |
6 | ; let arith = 1 + 2 * 4 | 6 | let arith = 1 + 2 * 4 |
7 | ; let cmp = 1 <= 2 | 7 | let cmp = 1 <= 2 |
8 | ; let logic = !true && false || (1 <= 2) | 8 | let logic = !true && false || (1 <= 2) |
9 | ; let bits = 0xff & 0b00001111 | 9 | let bits = 0xff & 0b00001111 |
10 | ; let block = { | 10 | let block = { |
11 | ; let a = 1 + 2 | 11 | let a = 1 + 2 |
12 | ; a + 3 | 12 | a + 3 |
13 | ; } | 13 | } |
14 | 14 | ||
15 | ; let maybe = if (1 == 2) { | 15 | let maybe = if (1 == 2) { |
16 | ; 32 | 16 | 32 |
17 | ; } else { | 17 | } else { |
18 | ; 44 | 18 | 44 |
19 | ; } | 19 | } |
20 | 20 | ||
21 | ; let single = if (true) { | 21 | ; let single = if (true) { |
22 | ; 123 | 22 | ; 123 |
@@ -46,15 +46,18 @@ | |||
46 | ; let a:my_struct | 46 | ; let a:my_struct |
47 | ; set a.field_a = 1 | 47 | ; set a.field_a = 1 |
48 | 48 | ||
49 | ; fun nested(): u32 { | 49 | fun nested(): int { |
50 | ; fun adder(a: u32, b: u32): u32 a + b | 50 | fun adder(a: u32, b: u32): u32 { |
51 | ; if (1 + 1 == 2) { | 51 | a + b |
52 | ; { | 52 | } |
53 | ; let b = 32 | 53 | if (1 + 1 == 2) { |
54 | ; } | 54 | let b = 15 |
55 | ; } | 55 | 5 + b |
56 | ; adder(1,2) | 56 | ; { |
57 | ; } | 57 | ; let b = 32 |
58 | ; } | ||
59 | } | ||
60 | } | ||
58 | 61 | ||
59 | ; enum field { | 62 | ; enum field { |
60 | ; a | 63 | ; a |
@@ -110,6 +113,9 @@ | |||
110 | ; 1 + 1 + c | 113 | ; 1 + 1 + c |
111 | ; } | 114 | ; } |
112 | fun foo(a: int b: str): (f64, f64) { | 115 | fun foo(a: int b: str): (f64, f64) { |
116 | fun bar(): nil { | ||
117 | println("ding") | ||
118 | } | ||
113 | if (a == 1) { | 119 | if (a == 1) { |
114 | ; return("test", b) | 120 | ; return("test", b) |
115 | return(3.0, 4.0) | 121 | return(3.0, 4.0) |