Commit Graph
693 Commits
Author SHA1 Message Date
Bob Nystrom 48a36adf4f Clean up runtime error handling.
This is prep work for being able to catch a runtime error from
another fiber.
2014-03-30 08:39:28 -07:00
Bob Nystrom 9a959c9eb9 Error if argument to new is not a class. 2014-03-06 06:51:16 -08:00
Bob Nystrom 44e68a5db9 Fix #31. Bitwise operators on numbers. 2014-02-24 07:27:43 -08:00
Kyle Marek-Spartz df4c1fa6b2 Changed phrasing, fixed and added a test. 2014-02-23 21:53:49 -06:00
Kyle Marek-Spartz 9f05e0d045 Include the receiver name in methodNotFound error messages.
> class Foo {}
> Foo.baz
Receiver 'Foo metaclass', does not implement method 'baz'.
2014-02-22 01:20:53 -06:00
Kyle Marek-Spartz 9792581292 Style choice: I had been writing methods with spaces before the arguments, but that doesn't seem to be the case in the documentation. This is just to keep things consistent 2014-02-18 11:55:55 -06:00
Kyle Marek-Spartz c43dbe96d3 Make custom bitwise operators work, add tests 2014-02-16 12:01:40 -06:00
Bob Nystrom f8a9d7f321 Make Sequence base class.
This lets us share functionality between List and Range (and
other user-defined sequence types).
2014-02-16 09:20:31 -08:00
Bob Nystrom e535d7a9e7 Conditional operator. 2014-02-15 11:36:01 -08:00
Bob Nystrom 4728687ca5 Merge branch 'feature/list-where' of git://github.com/zeckalpha/wren into zeckalpha-feature/list-where
Conflicts:
	builtin/core.wren
	src/wren_core.c
2014-02-15 11:21:24 -08:00
Bob Nystrom b672be8443 Merge pull request #18 from zeckalpha/feature/list-map
Add List.map method and test
2014-02-15 09:12:04 -08:00
Kyle Marek-Spartz 3409d588e5 Added List.where method and tests. 2014-02-15 00:42:14 -06:00
Kyle Marek-Spartz 10b335908c Two very unimportant changes: a typo and dead code. 2014-02-15 00:15:51 -06:00
Kyle Marek-Spartz 83ea5aaf45 Add List.map method and test 2014-02-14 23:06:29 -06:00
Bob Nystrom b1bae8fc6c Fix #17. 2014-02-14 20:15:49 -08:00
Bob Nystrom ea3cfa05bd Allow [0..-1] and [0...0] to work on empty lists. 2014-02-14 20:10:41 -08:00
Bob Nystrom ca7ff222fe Fix iterating over an empty list. 2014-02-14 17:24:06 -08:00
Kyle Marek-Spartz e519ecbc49 Third try. ;) Concat operator, tests. Now [1,2,3] + (4..6) works! Inlined helper functions to keep core lib small. 2014-02-14 11:16:57 -06:00
Bob Nystrom edd360a934 More fiber tests. 2014-02-14 07:16:56 -08:00
Bob Nystrom 756fe0d920 Make "this" the implicit receiver! 2014-02-12 17:33:35 -08:00
Bob Nystrom ec7e159017 Fix shrinking list capacity. 2014-02-10 07:55:14 -08:00
Bob Nystrom 1b4582fec3 Handle parameter list checking in closures. 2014-02-10 07:53:09 -08:00
Bob Nystrom ee04f1cf9c Correctly check bounds for method table. 2014-02-08 20:25:33 -08:00
Bob Nystrom e9ee4eb147 Add FFI support for returning strings and null. 2014-02-05 06:30:20 -08:00
Bob Nystrom 7726ee5131 Handle extra and missing arguments to fn.call. 2014-02-04 09:34:05 -08:00
Bob Nystrom 8d316396e1 Move clock into IO. 2014-02-04 08:49:16 -08:00
Bob Nystrom 36df70dba1 Move IO into a separate module. 2014-02-04 08:44:59 -08:00
Bob Nystrom ba06a4fd8a Define error type enum. 2014-02-03 06:51:44 -08:00
Bob Nystrom ac7cb594f4 Handle invalid string literals. 2014-02-02 10:31:46 -08:00
Bob Nystrom 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
gaodayue 092107742d hack unused-value warning on POP() to pass build 2014-02-02 01:12:52 +08:00
Bob Nystrom 66f0b57bf3 Allow ranges in list subscript operator. 2014-01-30 09:12:44 -08:00
Bob Nystrom a5e65faf0d Put the class name on the stack instead of as an arg. 2014-01-29 07:47:09 -08:00
Bob Nystrom 5c2cf641ae Make classes know their name. 2014-01-28 15:31:11 -08:00
Bob Nystrom 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
Bob Nystrom 27f458de8e Fix nasty bug in patching loop exits. 2014-01-26 17:24:59 -08:00
Bob Nystrom 96d728cc5d Reorganize makefile and scripts. 2014-01-23 23:29:50 -08:00
Bob Nystrom a4162a2eb3 Fix #6. Handle Ctrl-D in REPL. 2014-01-21 15:41:07 -08:00
Bob Nystrom b4915e70e3 Remove unneeded increment. 2014-01-21 08:23:30 -08:00
Bob Nystrom ac8fe926dc Moving marking in wren_value.c. 2014-01-21 08:20:00 -08:00
Bob Nystrom ce6ec301cf Check that RHS of "is" is a class. 2014-01-21 07:52:03 -08:00
Bob Nystrom 635d695083 Validate number comparison operand types. 2014-01-21 07:44:11 -08:00
Bob Nystrom 7b1b39bd2c Clean up runtime error string handling. 2014-01-20 22:55:11 -08:00
Bob Nystrom 90d1ed6aa6 Make null falsey. 2014-01-20 18:12:55 -08:00
Bob Nystrom 8c5ef693d0 Remove some stale TODOs. 2014-01-20 13:57:44 -08:00
Bob Nystrom 232eb9fab5 Clean up a bit of VM code. 2014-01-20 13:54:14 -08:00
Bob Nystrom d16e68b208 Use for loop in List.toString. 2014-01-20 13:43:22 -08:00
Bob Nystrom 46c1ba9249 Fix #2. Finish implementing Range.
Covers error and edge cases and fully tested now.
2014-01-20 13:20:22 -08:00
Bob Nystrom 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
Bob Nystrom 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