Skip to content

Commit 27cf4cd

Browse files
committed
Added back some loops
1 parent 960cde8 commit 27cf4cd

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

io/script.bolt

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ let add = (number a, number b) => {
44

55
let sum = add(5, 4)
66

7-
println(sum)
8-
97
let iife = ((bool a) => {
108
return a
119
})(true)

src/typing/inference.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export class Inferrer {
160160
// ifstatement.type = get return value type
161161
break;
162162
}
163-
/*case "WhileLoop": {
163+
case "WhileLoop": {
164164
const whileloop = statement as IfStatement;
165165
const testType = this.inferType(whileloop.test);
166166

@@ -169,17 +169,19 @@ export class Inferrer {
169169
whileloop
170170
);
171171

172-
this.scope(whileloop);
172+
whileloop.body.forEach(statement => this.inferType(statement));
173173
break;
174174
}
175175
case "ForEachLoop": {
176-
this.scope(statement as ForEachLoop);
176+
const foreachloop = statement as ForEachLoop;
177+
foreachloop.body.forEach(statement => this.inferType(statement));
177178
break;
178179
}
179180
case "ElseClause": {
180-
this.scope(statement as ElseClause);
181+
const elseclause = statement as ElseClause;
182+
elseclause.body.forEach(statement => this.inferType(statement));
181183
break;
182-
}*/
184+
}
183185
case "FunctionCall": {
184186
const functioncall = statement as FunctionCall;
185187

todo.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,22 @@
1717
- `continue`
1818
- `defer`
1919
- `assert`
20+
- Null values
2021

2122
### Parser
2223
- Errors
2324
- Easier to understand errors
2425
- Make keywords do something
26+
- Null values
2527

2628
### Inferrer
2729
- Function call correct parameter detection
30+
- Null checking & void functions
2831

2932
### WASM Generator
3033
- Add signatures for scoping
3134
- Unary operations
3235
- Strings
3336
- Incremental annonymous ids rather than random
34-
- Variables outside of functions should become global
37+
- Variables outside of functions should become global
38+
- Void functions

0 commit comments

Comments
 (0)