Commit Graph

138 Commits

Author SHA1 Message Date
Andrew Morris
95a1168bd6 Implement block statements 2022-05-12 16:24:32 +10:00
Andrew Morris
589d48a2e2 Refactor scope population, implement nested vars being at function level 2022-05-12 13:56:30 +10:00
Andrew Morris
987b71e4a5 Panic when overwriting scope name 2022-05-12 13:18:11 +10:00
Andrew Morris
d316ecb2b9 Split out compile_fn 2022-05-12 13:14:43 +10:00
Andrew Morris
9d3d179ffe Separate out function for compiling statements 2022-05-12 13:07:31 +10:00
Andrew Morris
49268e74c6 Refactor: separate FunctionCompiler struct 2022-05-12 13:03:02 +10:00
Andrew Morris
8b01ed9b4a Fix trailing whitespace 2022-05-12 12:36:15 +10:00
Andrew Morris
a4364e71a9 Fix main export naming/scoping issue 2022-05-12 12:26:22 +10:00
Andrew Morris
15bcfc90b5 Implement call expressions 2022-05-12 12:08:33 +10:00
Andrew Morris
a455930e58 Pass command line arguments to main function 2022-05-12 11:16:05 +10:00
Andrew Morris
9945676d46 Remove buggy available_register pattern 2022-05-12 10:50:57 +10:00
Andrew Morris
1658c19c1d Compile expression statements 2022-05-12 10:16:41 +10:00
Andrew Morris
54568ef1e4 Use definition allocator 2022-05-12 09:27:01 +10:00
Andrew Morris
605905fe7e Support variable declarations 2022-05-11 22:29:39 +10:00
Andrew Morris
0343c2bdc4 Implement referencing definitions and non-main function definitions 2022-05-11 22:00:33 +10:00
Andrew Morris
ecc2b88a31 Start populating top-level scope 2022-05-11 11:28:37 +10:00
Andrew Morris
fcce4bd15a wip scopes 2022-05-11 11:00:08 +10:00
Andrew Morris
5af8af20bd Add stubs for unimplemented declarations 2022-05-11 09:38:49 +10:00
Andrew Morris
51a76867c4 Implement empty statements 2022-05-11 09:32:20 +10:00
Andrew Morris
5c8ad46ef7 Add stubs for unimplemented statement types 2022-05-11 09:30:25 +10:00
Andrew Morris
e94e30eafc Compile this expressions 2022-05-11 09:25:29 +10:00
Andrew Morris
3b23063b8b Implement paren expressions 2022-05-11 09:08:37 +10:00
Andrew Morris
8f4b2bd309 Split out ExpressionCompiler functions 2022-05-11 09:04:32 +10:00
Andrew Morris
70b67e083b Create ExpressionCompiler struct 2022-05-11 08:54:48 +10:00
Andrew Morris
ba48082b39 Add unary+, unary- 2022-05-11 08:41:00 +10:00
Andrew Morris
6fb8ca3846 Compile unary operators 2022-05-11 08:33:05 +10:00
Andrew Morris
a789a5d0ad Improve register utilization 2022-05-06 13:09:53 +10:00
Andrew Morris
2e8cca1b97 Avoid end instruction for return statements at the end of functions 2022-05-06 12:19:24 +10:00
Andrew Morris
0a1f75e8b3 Compile literals without necessarily putting them in registers 2022-05-06 12:16:25 +10:00
Andrew Morris
87f1ffbd11 Binary operators 2022-05-06 11:38:42 +10:00
Andrew Morris
87a7125d8a Support more literals 2022-05-06 11:12:20 +10:00
Andrew Morris
208697506a Enable running typescript 2022-05-06 11:02:28 +10:00
Andrew Morris
829f464bf2 Write to out.vsm 2022-05-06 10:53:25 +10:00
Andrew Morris
822d6db8cb Compile string literals 2022-05-06 10:43:14 +10:00
Andrew Morris
39bdc0eb52 Stub for compiling statements 2022-05-06 10:07:01 +10:00
Andrew Morris
218e546b8c Progress on compiling main function 2022-05-06 09:34:29 +10:00
Andrew Morris
fb75bcf0f1 Name allocations 2022-05-06 08:46:13 +10:00
Andrew Morris
b11ea2abdc Get down to main_fn 2022-05-06 08:09:03 +10:00
Andrew Morris
b872165e2f wip compiler 2022-05-06 08:01:17 +10:00
Andrew Morris
40a990590c Add compile stub 2022-05-06 07:20:06 +10:00
Andrew Morris
6e1a14243d Enable typescript parsing 2022-05-06 07:08:31 +10:00
Andrew Morris
0bfc29aadf Add optional chaining and bitwise operators 2022-05-04 18:17:43 +10:00
Andrew Morris
48a2cf64a1 Fix strings 2022-05-04 16:44:15 +10:00
Andrew Morris
a9fb05e316 Handle unicode correctly when assembling 2022-05-04 16:11:21 +10:00
Andrew Morris
ab4d163e00 Add FIXME 2022-05-04 14:29:17 +10:00
Andrew Morris
f17f83f649 Implement (basic) subscripting 2022-05-04 14:13:37 +10:00
Andrew Morris
5501720285 Minor fix 2022-05-04 12:39:20 +10:00
Andrew Morris
b38498853c decode objects 2022-05-04 12:35:33 +10:00
Andrew Morris
869f026948 Add remaining operations as panic stubs 2022-05-04 12:17:31 +10:00
Andrew Morris
12347f2f4f Add typeof 2022-05-04 12:09:17 +10:00