Commit Graph

127 Commits

Author SHA1 Message Date
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
Andrew Morris
f770049aee More operators 2022-05-04 11:53:48 +10:00
Andrew Morris
cb1cf4cc76 Scaffolding for operations 2022-05-04 11:39:09 +10:00
Andrew Morris
a94d4313b7 Simplify with apply_binary_op, add more operations 2022-05-04 11:33:12 +10:00
Andrew Morris
15133bd4f1 Prefer moving Vals instead of passing by reference 2022-05-04 10:52:04 +10:00
Andrew Morris
44e8392248 Implement bind 2022-05-04 10:38:28 +10:00
Andrew Morris
ba048e3c56 Add stubs for all vm instructions 2022-05-04 08:54:13 +10:00
Andrew Morris
2f74466d70 Add project euler problem 2 solution 2022-05-03 21:18:17 +10:00
Andrew Morris
aa3f18ed20 Refactor Val to an enum 2022-05-03 21:04:36 +10:00
Andrew Morris
fd71d6f08c Implement apply 2022-05-03 17:07:46 +10:00
Andrew Morris
f387bdd396 Support decoding all instructions 2022-05-03 16:54:14 +10:00
Andrew Morris
fa64b907e2 Support undefined + null literals in vm 2022-05-03 13:00:48 +10:00