Commit Graph
100 Commits
Author SHA1 Message Date
Bob Nystrom 9a8f2edda4 List.addAll(). 2014-04-06 08:37:37 -07:00
Bob Nystrom 28021dc63e Redo site design. 2014-04-05 15:39:02 -07:00
Bob Nystrom bffb0e5d93 Start documenting functions. 2014-04-04 20:45:12 -07:00
Bob Nystrom 2da8025cd4 Fiber.create -> new Fiber 2014-04-04 18:24:55 -07:00
Bob Nystrom f5a9f39568 Check argument type in new Fn. 2014-04-04 18:13:13 -07:00
Bob Nystrom 4a8cf3a7bf Move newline handling down into parser.
This lets us make it a grammar feature and not a lexer trick.
Newlines are explicitly ignored in some parts of the grammar. This
lets, for example, things like "|" ignore the newline when used as
an operator, but not when used as a parameter delimiter in a block
argument.
2014-04-04 07:51:18 -07:00
Bob Nystrom da4cadf16b Unify body handling.
Blocks, functions, and methods now have the same code for handling
their bodies.

This means that single-line methods work like single-line functions:
they return the result of their expression.
2014-04-03 07:48:19 -07:00
Bob Nystrom 55c2c6ffb0 Remove old function syntax. 2014-04-02 20:22:36 -07:00
Bob Nystrom d146018559 Convert all fns to block arg syntax. 2014-04-02 19:41:53 -07:00
Bob Nystrom a550d6cea4 Change how new operators are compiled.
Instead of an instruction that always instantiates an instance,
the "new" is compiled to a method call on the class, followed by a
method call on the (presumably) new instance.

The former lets built-in types like Fn do special stuff instead of
allocating an instance. In particular, it means:

  new Fn { ... }

can just return the block argument.
2014-04-02 17:42:30 -07:00
Bob Nystrom cc56ac4da7 Convert fiber tests to use block arguments. 2014-04-02 17:31:58 -07:00
Bob Nystrom dc366185bd Add support for block arguments in method calls. 2014-04-02 17:26:39 -07:00
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
Bob Nystrom 161075affe Merge pull request #39 from zeckalpha/feature/methodNotFound-receiver
Include the receiver name in methodNotFound error messages.
2014-02-24 07:03:56 -08:00
Bob Nystrom 97235caf9c Reword code size limit. 2014-02-19 07:14:46 -08:00
Bob Nystrom a3086a0306 Merge pull request #38 from zeckalpha/feature/corelib-spaces
Remove spaces before arguments in core.wren
2014-02-19 07:13:03 -08:00
Bob Nystrom 001a8fe54f Merge pull request #37 from zeckalpha/feature/docs-todos
Feature/docs todos
2014-02-19 07:12:33 -08:00
Bob Nystrom 60613c486f Merge pull request #33 from zeckalpha/feature/docs-punctuation
Punctuation choices
2014-02-19 07:10:38 -08:00
Bob Nystrom b59f33fa6f Merge pull request #36 from zeckalpha/feature/docs-title-in-template
Move title to left side for when there are many tabs open.
2014-02-17 10:27:27 -08:00
Bob Nystrom 177ba58c61 Merge pull request #32 from zeckalpha/feature/docs-indentation
Change indentation to match 2 space indents seen elsewhere
2014-02-17 10:20:33 -08:00
Bob Nystrom 6d9842b148 Merge pull request #27 from zeckalpha/feature/bitwise-operators
Make custom bitwise operators work, add tests
2014-02-16 17:43:40 -08:00
Bob Nystrom 681ec5aa13 Merge pull request #26 from zeckalpha/feature/docs-io
Update a bunch of `io` to `IO` in docs.
2014-02-16 17:37:45 -08:00
Bob Nystrom 719139a446 Merge branch 'master' of https://github.com/munificent/wren 2014-02-16 09:20:43 -08: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 46de1ec1ea Merge pull request #22 from zeckalpha/master
Spelling typos in docs: "rivaling", "carnival"
2014-02-16 08:51:34 -08:00
Bob Nystrom 4d8bf4bc8e Update benchmark to use ? and .where(). 2014-02-15 11:59:56 -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
Bob Nystrom c67b239d06 Merge pull request #19 from zeckalpha/feature/c-small-fixes
Two very unimportant changes: a typo and dead code.
2014-02-14 22:22:15 -08: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
Bob Nystrom edd360a934 More fiber tests. 2014-02-14 07:16:56 -08:00
Bob Nystrom ca4f4d6660 Test "this" in static methods. 2014-02-14 06:37:37 -08:00
Bob Nystrom 59bb7eec7a Remove some outdated TODOs.
They’re TODONE!
2014-02-13 08:38:44 -08:00
Bob Nystrom 756fe0d920 Make "this" the implicit receiver! 2014-02-12 17:33:35 -08:00
Bob Nystrom 92971d1cfa Add python3 to benchmarks. 2014-02-12 17:22:42 -08:00
Bob Nystrom 8ebbba2bc0 Get delta_blue benchmark working in Wren. 2014-02-10 07:56:11 -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 4e10445952 Work on class docs a bit. 2014-02-04 08:45:08 -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 7e850637f9 Allow passing a suite to make test. 2014-02-02 10:30:58 -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
Bob Nystrom 0b641939d4 Merge pull request #10 from gaodayue/fixbuild
hack unused-value warning on POP() to pass build
2014-02-01 10:42:09 -08:00
Bob Nystrom 4606d80a61 Tweak doc generation script a bit. 2014-01-31 20:55:37 -08:00
Bob Nystrom 498e163580 Merge pull request #9 from zeckalpha/master
Recopy css if it has been modified.
2014-01-31 20:51:30 -08:00
Bob Nystrom 3bc79af83a Docs for lists. 2014-01-31 17:51:09 -08:00
Bob Nystrom 25a6565f9f Merge pull request #7 from zeckalpha/master
#!/usr/bin/env python
2014-01-31 16:40:17 -08:00
Bob Nystrom 66f0b57bf3 Allow ranges in list subscript operator. 2014-01-30 09:12:44 -08:00
Bob Nystrom f2aeb30b31 Hack on the docs a bit. 2014-01-30 06:51:52 -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 74d045540b Merge branch 'master' of git://github.com/zeckalpha/wren into zeckalpha-master 2014-01-21 15:29:43 -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 95d239cd21 Lots of work on docs. 2014-01-20 21:44:51 -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 ce2b45de53 Use for loop in binary_trees benchmark. 2014-01-20 13:46:37 -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 d40d04f0c5 Include numeric loop in for benchmark. 2014-01-20 08:43:10 -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
Bob Nystrom 2a68c8ee1d Reorganize code for tracking enclosing class. 2014-01-18 14:03:52 -08:00
Bob Nystrom 8027143381 Static field tokens. 2014-01-18 09:33:18 -08:00
Bob Nystrom 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
Bob Nystrom 1d808cf49c Include function name in assertion message. 2014-01-17 17:21:38 -08:00
Bob Nystrom f163afb865 Don’t allow fields in static methods. 2014-01-16 07:09:43 -08:00
Bob Nystrom e493ac7cf4 Check for number of field overflow. 2014-01-15 07:59:10 -08:00
Bob Nystrom eb1c0284dd Handle references to fields with inheritance in closures. 2014-01-15 07:03:24 -08:00
Bob Nystrom 9e30fa67ed Fix a few typos in the docs. 2014-01-13 20:23:11 -08:00
Bob Nystrom 7580c05013 Merge pull request #1 from b01dface/master
Minor typos and documentation updates.
2014-01-13 20:22:10 -08:00
Bob Nystrom 788762c970 Add LuaJIT to benchmark. 2014-01-13 07:29:47 -08:00
Bob Nystrom 4b8b676ffe Handle errors with fiber usage. 2014-01-13 06:58:27 -08:00
Bob Nystrom 52a6d6d69c Free GC objects when VM is freed. 2014-01-13 06:48:53 -08:00
Bob Nystrom 8e8bb4b9b9 Allow returns without an explicit value. 2014-01-12 19:37:11 -08:00
Bob Nystrom cf623844c4 Other escape codes. 2014-01-12 19:24:30 -08:00
Bob Nystrom 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
Bob Nystrom 86d93296ab Fix doc. 2014-01-12 10:58:13 -08:00
Bob Nystrom a8b51f6c8b Fill in some more mathematical functions. 2014-01-08 07:47:14 -08:00
Bob Nystrom 9645ddcb26 Add a little ASCII art Mandelbrot example. 2014-01-07 23:04:30 -08:00