Commit Graph

221 Commits

Author SHA1 Message Date
ee04f1cf9c Correctly check bounds for method table. 2014-02-08 20:25:33 -08:00
e9ee4eb147 Add FFI support for returning strings and null. 2014-02-05 06:30:20 -08:00
7726ee5131 Handle extra and missing arguments to fn.call. 2014-02-04 09:34:05 -08:00
8d316396e1 Move clock into IO. 2014-02-04 08:49:16 -08:00
36df70dba1 Move IO into a separate module. 2014-02-04 08:44:59 -08:00
ba06a4fd8a Define error type enum. 2014-02-03 06:51:44 -08:00
ac7cb594f4 Handle invalid string literals. 2014-02-02 10:31:46 -08:00
b576d546e9 Add DROP() macro for popping and discarding the result.
Avoids unused-value warnings where the result of POP() isn’t used.
2014-02-01 10:44:47 -08:00
092107742d hack unused-value warning on POP() to pass build 2014-02-02 01:12:52 +08:00
66f0b57bf3 Allow ranges in list subscript operator. 2014-01-30 09:12:44 -08:00
a5e65faf0d Put the class name on the stack instead of as an arg. 2014-01-29 07:47:09 -08:00
5c2cf641ae Make classes know their name. 2014-01-28 15:31:11 -08:00
9739bc7b30 Get rid of separate CODE_SUBCLASS instruction.
Just pushes null to indicate "inherits from Object". Unifies a
bit of code.
2014-01-26 17:25:38 -08:00
27f458de8e Fix nasty bug in patching loop exits. 2014-01-26 17:24:59 -08:00
96d728cc5d Reorganize makefile and scripts. 2014-01-23 23:29:50 -08:00
a4162a2eb3 Fix #6. Handle Ctrl-D in REPL. 2014-01-21 15:41:07 -08:00
b4915e70e3 Remove unneeded increment. 2014-01-21 08:23:30 -08:00
ac8fe926dc Moving marking in wren_value.c. 2014-01-21 08:20:00 -08:00
ce6ec301cf Check that RHS of "is" is a class. 2014-01-21 07:52:03 -08:00
635d695083 Validate number comparison operand types. 2014-01-21 07:44:11 -08:00
7b1b39bd2c Clean up runtime error string handling. 2014-01-20 22:55:11 -08:00
90d1ed6aa6 Make null falsey. 2014-01-20 18:12:55 -08:00
8c5ef693d0 Remove some stale TODOs. 2014-01-20 13:57:44 -08:00
232eb9fab5 Clean up a bit of VM code. 2014-01-20 13:54:14 -08:00
d16e68b208 Use for loop in List.toString. 2014-01-20 13:43:22 -08:00
46c1ba9249 Fix #2. Finish implementing Range.
Covers error and edge cases and fully tested now.
2014-01-20 13:20:22 -08:00
97bf314f4b Make Range a native object type.
Still need to implement better semantics, but this is an 
important first step. It's much faster now too, which is good.
2014-01-20 08:45:15 -08:00
83b5968340 Get static methods fully working.
They are compiled as local variables defined in an implicit
scope surrounding the class. This has the right semantics and,
better, means that there's no VM support needed for them.

They're purely syntax sugar.
2014-01-19 13:01:51 -08:00
2a68c8ee1d Reorganize code for tracking enclosing class. 2014-01-18 14:03:52 -08:00
8027143381 Static field tokens. 2014-01-18 09:33:18 -08:00
e8791b6bab Don't inherit metaclasses.
Also disallow super() in static methods. It won't do anything
useful (it always just delegates to Class) anyway.
2014-01-17 17:29:10 -08:00
1d808cf49c Include function name in assertion message. 2014-01-17 17:21:38 -08:00
f163afb865 Don’t allow fields in static methods. 2014-01-16 07:09:43 -08:00
e493ac7cf4 Check for number of field overflow. 2014-01-15 07:59:10 -08:00
eb1c0284dd Handle references to fields with inheritance in closures. 2014-01-15 07:03:24 -08:00
d8378aceed Fix an error message. 2014-01-13 20:21:25 -05:00
4b8b676ffe Handle errors with fiber usage. 2014-01-13 06:58:27 -08:00
52a6d6d69c Free GC objects when VM is freed. 2014-01-13 06:48:53 -08:00
8e8bb4b9b9 Allow returns without an explicit value. 2014-01-12 19:37:11 -08:00
cf623844c4 Other escape codes. 2014-01-12 19:24:30 -08:00
f3a1f7e677 Fibers!
Still have some edge cases to implement but the basics are in
place and working now.
2014-01-12 11:02:07 -08:00
a8b51f6c8b Fill in some more mathematical functions. 2014-01-08 07:47:14 -08:00
8f316f39f8 Support longer jumps. 2014-01-07 23:03:38 -08:00
074c016c89 Num.floor. 2014-01-07 23:03:25 -08:00
e64d8ace9a Ensure upvalue value is initialized.
Avoids a crash if a GC happens before the upvalue is closed.
2014-01-07 23:03:15 -08:00
3be059a137 Fix scoping and break statements.
Variables declared in the loop were not properly disposed of
when you broke out of the loop.
2014-01-06 08:01:04 -08:00
90a769b6d1 Correctly terminate debug function name. 2014-01-06 07:54:00 -08:00
46e1e7f069 Make string buffer for converting number to string large enough. 2014-01-06 07:53:41 -08:00
b979272305 Clean up text handling a bit:
- Rename IO.write -> IO.print.
- Make IO.write not print a newline.
- Support \u Unicode escapes in strings.
2014-01-05 12:27:12 -08:00
870f3b8b93 Allow more than 256 methods and constants.
Class symbol tables now grow on demand, and the relevant
instructions take 16-bit arguments. There's a small perf hit
for this, but only a few percent, which is good.
2014-01-04 11:08:31 -08:00