Commit Graph
250 Commits
Author SHA1 Message Date
Bob Nystrom b80ba29b0e Merge branch 'master' of https://github.com/munificent/wren 2015-03-17 07:01:09 -07:00
Bob Nystrom b4fa4acce1 Handle empty string map keys. 2015-03-17 07:00:54 -07:00
Thorbjørn Lindeijer d7a91117ac Reverse the argument order of List.insert
The previous order, insert(element, index), was counter-intuitive.
I'm not aware of any list API that uses this order. I've checked:

* Ruby Array.insert(index, obj...)
* JavaScript array.splice(start, deleteCount[, item1[, item2[, ...]]])
* C++ / QList::insert(int i, const T & value)
* C++ / std::vector::insert
* Lua table.insert (list, [pos,] value)
* C# List<T>.Insert(int index, T item)
* Java Interface List<E>.add(int index, E element)
* Python list.insert(i, x)

So it seemed to me more like an oversight in Wren.
2015-03-15 22:51:24 +01:00
Bob Nystrom 64eccdd9be Reorganize tests and benchmark scripts.
Mainly to get rid of one top level directory. But this will
also be useful when there are tests of the embedding API.
2015-03-14 12:45:56 -07:00
Bob Nystrom 5459993857 Add Class.supertype.
Thanks, Michel!
2015-03-14 09:48:45 -07:00
Bob Nystrom 69567c5eb5 Control string representation of infinity. 2015-03-13 07:35:10 -07:00
Bob Nystrom b36b71d3c6 Merge pull request #212 from soveran/io-read-eof
Change IO.read to return null on EOF
2015-03-07 13:47:07 -08:00
Bob Nystrom 05ba7d9fbf Add fiber features needed for to write an external scheduler:
- Allow yielding the main fiber. This exits the interpreter. The
  host can resume it by calling a method.
- Allow getting a reference to the current fiber.
2015-03-07 12:32:11 -08:00
Michel Martens 542a783cb4 Change IO.read to return null on EOF 2015-03-07 09:10:18 +00:00
Bob Nystrom 632a01d584 Merge branch 'num_methods' of git://github.com/MarcoLizza/wren into MarcoLizza-num_methods 2015-03-06 22:43:02 -08:00
Bob Nystrom d35e3c917c Add count to Sequence. 2015-03-06 07:01:02 -08:00
Marco Lizza d56e2d6398 Removing old tests. 2015-03-05 11:27:56 +01:00
Marco Lizza 130d0df957 Fixing the test a bit. 2015-03-05 11:24:54 +01:00
Marco Lizza fde6f74d15 Adding tests. 2015-03-04 16:12:08 +01:00
Bob Nystrom 90aa43450b Merge branch 'master' of git://github.com/bjorn/wren into bjorn-master 2015-03-03 07:23:47 -08:00
Bob Nystrom 28005ed47a Refactor number parsing a bit. 2015-03-03 07:17:56 -08:00
Gavin Schulz 0ec31433c8 Generate an error if a number literal is too large to be represented with the Num class. 2015-03-03 00:07:55 -08:00
Thorbjørn Lindeijer 8f985847d4 Added Sequence.any as complement to Sequence.all 2015-03-01 23:14:32 +01:00
Bob Nystrom c27a094882 Reorganize superclass validation a bit. 2015-02-27 08:08:27 -08:00
Bob Nystrom 46713a5bb3 Merge branch 'issue-70' of git://github.com/verpeteren/wren into verpeteren-issue-70 2015-02-27 07:41:25 -08:00
Bob Nystrom 96ceaa528b Allow empty argument list methods.
- Compile them as calls and definitions.
- Use them for call(), clear(), run(), try(), and yield().
- Update the docs.
2015-02-26 23:08:36 -08:00
Bob Nystrom 1aaa8cff52 Use more comprehensive signature strings for methods. 2015-02-26 21:56:15 -08:00
Peter Reijnders f05d6143f5 Generating a runtime error on subclassing of builtins
As discussed in https://github.com/munificent/wren/issues/70, it is not allowed to subclass built-in types.
2015-02-25 20:13:37 +01:00
Bob Nystrom 6a10d9740c Merge pull request #187 from MarcoLizza/bitwise_precedence
Bitwise precedence
2015-02-25 07:14:31 -08:00
Bob Nystrom fc2ed6f6e1 Don't allow trailing non-number characters when parsing a string to a number. 2015-02-25 07:07:54 -08:00
Marco Lizza cec1f9160a Moving bitwise precedence-test to the correct folder. 2015-02-25 16:00:53 +01:00
Gavin Schulz f4a39bc943 Code review changes. 2015-02-25 01:20:53 -08:00
Marco Lizza dfa1b51663 Add bitwise operators precedence test. 2015-02-23 17:29:31 +01:00
Gavin Schulz 03a5b96040 Add a fromString static method on Num that converts strings to numbers. 2015-02-22 20:06:17 -08:00
Bob Nystrom 0f9e15833f Unify argument parsing. Fix #24. 2015-02-22 10:42:49 -08:00
Bob Nystrom ae88ee539d Merge branch 'master' of https://github.com/munificent/wren 2015-02-18 07:55:38 -08:00
Bob Nystrom b2ca4c0381 Allow zero or multiple imported names. 2015-02-17 07:32:33 -08:00
Marco Lizza 00cdef303c Adding new bitwise operands tests. 2015-02-16 11:30:15 +01:00
Bob Nystrom a44d479643 Basic import syntax. 2015-02-14 16:46:00 -08:00
Bob Nystrom bc5a793c41 Split out the core and main modules.
- Implicitly import everything in core into every imported module.
- Test cyclic imports.
2015-02-11 10:06:45 -08:00
Bob Nystrom 2005e1e0a2 Add ".wren" to modules in the embedder. 2015-02-06 11:52:05 -08:00
Bob Nystrom bb647d4247 Start getting module loading working.
Right now, it uses a weird "import_" method on String which
should either be replaced or at least hidden behind some syntax.

But it does roughly the right thing. Still lots of corner cases to
clean up and stuff to fix. In particular:

- Need to handle compilation errors in imported modules.
- Need to implicitly import all core and IO types into imported module.
- Need to handle circular imports.
  (Just need to give entry module the right name for this to work.)
2015-02-06 07:01:15 -08:00
Bob Nystrom 55caae343b Add "." to comments. :) 2015-02-04 20:26:29 -08:00
Bob Nystrom ddd20c687e Merge branch 'master' into MarcoLizza-8_bit_strings_tests 2015-02-04 20:25:12 -08:00
Bob Nystrom 878be6fb6b Clean up wrenStringFind() a bit. 2015-02-04 20:23:50 -08:00
Marco Lizza d73b19967d Adding 8-bit strings test cases. 2015-02-04 13:58:16 +01:00
Bob Nystrom 0aa4d7c2bd Fix crash when doing a lookup on an empty map. 2015-01-28 19:19:04 -08:00
Gavin Schulz f482a53d0e Define equality on ranges. 2015-01-25 19:50:54 -08:00
Bob Nystrom 41d9ba9b3d Merge branch 'hex-literals' of git://github.com/gsmaverick/wren into gsmaverick-hex-literals 2015-01-25 17:49:05 -08:00
Bob Nystrom 4579171afa Add remove() to Map. 2015-01-25 17:42:36 -08:00
Gavin Schulz 0ad7a7d9ff Code review changes. 2015-01-25 13:02:44 -08:00
Bob Nystrom 0e6a90443e Add containsKey() to Map, and validate key types. 2015-01-25 12:39:19 -08:00
Bob Nystrom 492c730e6f Key and value iteration for maps. Also toString. 2015-01-25 10:27:38 -08:00
Bob Nystrom 251b623c65 Map "clear" method. 2015-01-25 08:39:44 -08:00
Bob Nystrom e740a4c95a Map literals! 2015-01-24 23:21:50 -08:00