Commit Graph
425 Commits
Author SHA1 Message Date
Bob Nystrom 3feb72041e Tweak style a bit. 2015-01-11 19:52:59 -08:00
Bob Nystrom ab1c5aca0c Merge branch 'Fix-CRLF-bug' of git://github.com/elder-george/wren into elder-george-Fix-CRLF-bug 2015-01-11 19:52:08 -08:00
Bob Nystrom 650a70b9a3 Merge pull request #96 from zeckalpha/feature/set-example_updated_syntax
Set example updated syntax
2015-01-11 19:50:07 -08:00
Bob Nystrom 6bd245b4b2 Tweak comment. 2015-01-11 19:44:35 -08:00
Bob Nystrom be0032cc40 Merge branch 'segfault_on_top_level_super_with_no_args' of git://github.com/zeckalpha/wren into zeckalpha-segfault_on_top_level_super_with_no_args 2015-01-11 19:42:26 -08:00
Bob Nystrom bc29e0929e Rename a couple of files and tweak some docs. 2015-01-11 19:13:15 -08:00
Gavin Schulz 7557c91b3c Adds some common methods to strings. 2015-01-11 16:06:56 -08:00
Kyle Marek-Spartz c376d88e61 super at top level: Allow the compiler to continue compilation after erroring. Added two more tests. 2015-01-11 17:44:10 -06:00
Kyle Marek-Spartz c0b0920d67 Update set example to new Syntax. Replaces #30 2015-01-09 16:02:40 -06:00
Kyle Marek-Spartz 3490c8d2f3 Segfault when calling super at top-level with no arguments.
If enclosingClass is null, we can't proceed with compilation since we don't have its name.
2015-01-09 15:14:06 -06:00
Bob Nystrom 3116bf97de Use correct buffer size in string subscript operator. 2015-01-09 07:12:25 -08:00
Bob Nystrom bcf052436f Merge pull request #94 from edsrzf/fix-neg-number
Don't treat negative numbers as literals
2015-01-09 07:00:12 -08:00
Evan Shaw 75d28c083c Don't treat negative numbers as literals
Fixes #93.

Previously, "1 -1" was lexed as two number tokens: a positive literal and
a negative literal. This caused problems when it came to parsing.

Now the '-' and the second number are separate tokens.

Note this is a breaking change, since `-16.sqrt` is now parsed as `-(16.sqrt)`,
as opposed to `(-16).sqrt`.

There is a small bit of overhead to doing it this way, but it might be possible
to optimize that out in the compiler at some point in the future.
2015-01-09 20:17:40 +13:00
Bob Nystrom efabf20fee Make a few changes to methodNotFound():
- Move closer to other runtime error code.
- Make it static since it's private to wren_vm.h.
- Allocate a managed ObjString* for the message so the GC can handle it.
  That's how it ends up anyway, so this cuts out the middle man.
- Use a width specifier in sprintf() to print the canonical method name.
2015-01-08 22:29:37 -08:00
Bob Nystrom a9f1d52ef7 Merge branch 'improve-debugging' of git://github.com/gsmaverick/wren into gsmaverick-improve-debugging 2015-01-08 21:49:20 -08:00
Gavin Schulz 15da548f48 Code review changes. 2015-01-08 21:30:47 -08:00
Bob Nystrom 15b0d8777c Handle toString not returning a string in IO.print and IO.write.
Fix #67.
2015-01-08 07:53:37 -08:00
Bob Nystrom a9a676d706 Merge branch 'master' of https://github.com/munificent/wren 2015-01-08 07:41:49 -08:00
Bob Nystrom 1a7f849c42 Store string length as an int instead of size_t.
Saves a few bits, and avoids some signed/unsigned conversions.
It's also consistent with other places string lengths are stored in the VM.
2015-01-08 07:41:30 -08:00
Bob Nystrom 1e6241a7df Merge pull request #81 from edsrzf/sprintf-return
Use the return value of sprintf to avoid strlen calls
2015-01-08 07:01:21 -08:00
Evan Shaw 648ee727a1 Fix style nits 2015-01-08 19:34:58 +13:00
Evan Shaw 68adc3f511 Use the return value of sprintf to avoid strlen calls 2015-01-08 13:46:33 +13:00
Evan Shaw 5261ef498f Optimize string methods for stored length
wrenStringConcat could still make use of this info, but that's a more involved
change.
2015-01-08 11:09:11 +13:00
Evan Shaw 3fd348e6c1 Store string length
Strings are still null-terminated so that they can be treated as C strings.
2015-01-08 10:05:51 +13:00
Bob Nystrom b30f8446f8 Merge branch 'string-flexible-array' of git://github.com/edsrzf/wren into edsrzf-string-flexible-array 2015-01-07 07:20:12 -08:00
Bob Nystrom 6adf8c40e1 Don't use printf() to format NaNs since the output isn't fully specified. Fix #65. 2015-01-06 07:09:45 -08:00
Evan Shaw e3b5206ca8 Use a flexible array for strings 2015-01-06 19:08:42 +13:00
Yury Korchemkin 7fb18d7843 Made \r treated as a whitespace character. 2015-01-05 18:33:49 -08:00
Paul Woolcock 7ecff2d79f Implement IO.read 2015-01-04 19:54:28 -05:00
Yury Korchemkin 6912eec6a7 Adding support for '\r' char to lexer. 2015-01-04 14:25:17 -08:00
Bob Nystrom 52bd38f3bd Don't double report lexer errors. 2015-01-04 13:10:46 -08:00
Bob Nystrom 09bb28735c Merge branch 'feature-shebang-support' of git://github.com/mauvm/wren into mauvm-feature-shebang-support 2015-01-04 13:02:42 -08:00
Bob Nystrom a9bb2387a1 Handle empty (or comment-only) files. Fix #57. 2015-01-04 13:00:53 -08:00
Gavin Schulz 7f90485cff Let the user know the arity of a missing method in the error message. 2015-01-04 14:42:11 -05:00
mauvm 6c549e0cc5 Use lexError() and add test for invalid shebang. 2015-01-04 19:56:16 +01:00
mauvm dfb381e43b Remove duplicate comment. Oops. 2015-01-04 08:52:40 +01:00
Bob Nystrom e46d2e479b Merge pull request #55 from gsmaverick/repl-newline
Don't try to run an empty line in the REPL.
2015-01-03 23:40:20 -08:00
mauvm fa96fb0a8e Let compiler ignore shebang on first line. 2015-01-03 20:53:12 +01:00
Gavin Schulz e3e358fb61 Don't try to run an empty line in the REPL. 2015-01-03 14:25:10 -05:00
Bob Nystrom c25cfca18b Eliminate semicolons entirely. 2015-01-03 10:02:45 -08:00
Aleksander 150ea237e9 Added test and fixed skipping whitespace 2015-01-03 14:57:34 +01:00
Bob Nystrom b33dcf0da5 Name the anonymous union since strict C99 doesn't allow it. 2015-01-02 20:17:10 -08:00
Aleksander dd686a808d Make tab(\t) a valid whitespace character. 2015-01-02 23:22:09 +01:00
Bob Nystrom f028544b53 CamelCase. 2015-01-02 07:31:02 -08:00
Paul Woolcock 25b31a206a Check the return value of getline
Otherwise, `gcc` warns, which causes the build to fail
2015-01-02 09:32:29 -05:00
Bob Nystrom 42816c46ee Add TODO for arity getter. 2015-01-01 18:49:10 -08:00
Bob Nystrom c967439ead Add Fiber.abort() method. 2015-01-01 10:40:14 -08:00
Bob Nystrom 93ced56a7a Clean up corner case for empty list range. 2014-12-31 10:34:44 -08:00
Bob Nystrom 46733391c1 User pointer for stack top instead of array index.
Cleans up a bunch of stack calculation.
2014-12-31 10:34:27 -08:00
Bob Nystrom 2656487f71 Store the start of the current frame's stack in a local.
binary_trees - wren           ..........  3337  0.30s   99.03% relative to baseline
delta_blue - wren             ..........  6989  0.14s   97.90% relative to baseline
fib - wren                    ..........  2985  0.33s  121.72% relative to baseline
for - wren                    ..........  8530  0.12s   99.06% relative to baseline
method_call - wren            ..........  5047  0.20s   98.74% relative to baseline
2014-12-08 06:57:36 -08:00