Commit Graph
978 Commits
Author SHA1 Message Date
ruby0x1 8229047c3b update code to use wren 0.4.0 2021-04-25 20:52:27 -07:00
Tarcisio Gruppi 0a5f58309d Updated Process.arguments to only return slice if arg count >= 2 (#61) 2021-04-25 11:03:18 -07:00
underscorediscovery b82cf5a2e2 Fix use of platform specific defines, and remove unnecessary warnings.
Note that PATH_MAX is basically a made up number, as is the * 4 here.
MAX_PATH on windows is outdated (and tiny).

Effectively none of the macros can tell you the kernel or driver level limitations anyway, so this is a best effort guess based on the best effort guess that is prevalent already in c headers.

This particular constant usage can be looked at closer another time, but this is to fix a broken build.
2020-06-15 15:25:46 -07:00
Dario Vladović e4a0fa485e Implement Process.version (#42)
* Implement `Process.version`
* Update`os` test suite
2020-06-13 21:23:02 -07:00
Dario Vladović 1ab88ed201 Implement Process.cwd (#41)
* Implement `Process.cwd`
* Update `os` test suite
2020-06-13 21:12:34 -07:00
Dario Vladović cbd65982cc Fix readme typo (#39) 2020-06-13 21:06:00 -07:00
Dario Vladovic 32b5c96279 Format help output
Add missing `--version` option to optional
arguments listing.
2020-06-06 04:55:54 +02:00
underscorediscovery 6c936d4547 0.3.0: cli can use more portable S_IFDIR 2020-02-11 20:21:58 -08:00
underscorediscovery b89a3cc111 0.3.0: minor tidying 2020-02-11 20:20:34 -08:00
underscorediscovery 934cc32b37 0.3.0: remove vm src 2020-02-11 20:16:32 -08:00
kawa-yoiko 6ab4abe9e3 cli; Fix a memory leak in findModulesDirectory() (#718) 2019-12-27 10:42:32 -08:00
Thorbjørn Lindeijer 186a8c7c13 Fixed Random.sample(list, count) for small number of samples (#714)
Closes #713
2019-12-11 15:40:07 -08:00
underscorediscovery b120739631 fix minor warning 2019-10-07 23:43:05 -07:00
underscorediscovery 5338275dcd 0.2.0 prep work 2019-09-30 21:38:08 -07:00
underscorediscovery 3eb4ac1419 Add a clearer error message for forward declared lowercase variables (#699)
* Add better error messaging for forward referenced top level variables, see #467
* add test case
2019-09-30 20:30:27 -07:00
underscorediscovery 688691b17c Don't access null pointers when printing null module names
fixes #631
2019-09-18 22:49:01 -07:00
Sven Bergström 898e5356c7 Merge pull request #562 from Salmela/locals-array-overflow-fix
Check that there is space in local variable array
2019-09-18 00:20:03 -07:00
underscorediscovery cdeb0db5c3 disambiguate the call here from the call in wren_compiler.c (fixes amalgamation having overalapped symbols) 2019-09-18 00:08:07 -07:00
underscorediscovery 123ba80a89 fix warning about conversion from '__int64' to 'double', possible loss of data 2019-09-18 00:05:16 -07:00
Matus Novak f91586a71a Fix wrenAbortFiber does not work inside of foreign class allocator 2019-09-17 19:43:53 +02:00
Robert Nystrom 2a1499b04b Fix horrendously bad bit hashing function.
hashBits() is used to generate a hash code from the same 64 bits used
to represent a Wren number as a double. When building a map containing
a large number of integer keys, it's important for this to do a good
job scattering the bits across the 32-bit key space.

Alas, it does not. Worse, the benchmark to test this happens to stop
just before the performance falls off a cliff, so this was easy to
overlook.

This replaces it with the hash function V8 uses, which has much better
performance across the numeric range.
2019-07-27 13:34:07 -07:00
vvn 5725ecad67 Update path.c 2019-06-13 14:51:28 +08:00
Walter Schell a437e804ba Added String.fromByte with docs and unit test 2019-02-27 08:10:54 -05:00
kai c58e51fa96 Fixed compiling error of cli on Windows 2019-02-19 15:14:53 +08:00
Bob Nystrom 1ec0b649c1 Merge pull request #589 from FICTURE7/master
Renamed include guard in wren_compiler.h
2019-02-15 07:30:46 -08:00
Bob Nystrom 51c857ab0e Merge pull request #610 from jyaif/bar
Remove unused prototype.
2019-02-15 07:30:16 -08:00
Bob Nystrom abbb410ff2 Fix assert in insertEntry().
The intent of the assert is to ensure that insertEntry() is not called
with an empty entries array because that would cause you to get into a
code path where the entry output parameter is not set. But the assert
didn't correctly check that.

Fix #635.
2019-02-14 07:51:57 -08:00
Bob Nystrom 03d70f336f Merge pull request #620 from PrimordialHelios/fixup_overflow
Fix overflow on line 401 of wren_compiler.c
2019-02-14 07:42:12 -08:00
Bob Nystrom b2a2494008 Regenerate REPL include. 2019-02-14 07:33:30 -08:00
Bob Nystrom 35df7faa1e Merge branch 'repl_keys' of https://github.com/PrimordialHelios/wren into PrimordialHelios-repl_keys
# Conflicts:
#	AUTHORS
2019-02-14 07:31:22 -08:00
Sven Bergström 8a0d2297a1 Merge pull request #615 from iwillspeak/repl-escape-fix
Fixup Handling of `\` in REPL to Prevent Crash
2019-02-11 22:58:06 -08:00
Bob Nystrom 52c16b4f80 Merge branch 'wrenHasError' of https://github.com/mhermier/canary into mhermier-wrenHasError 2019-02-11 07:52:38 -08:00
Bob Nystrom a5147aa2d9 Add a limited form of re-entrant calls.
This doesn't let you arbitrarily call back into the VM from within
foreign methods. I'm still not sure if that's even a good idea since
God knows what that would mean if you switch fibers while doing that.

But this does allow the very important use case of being able to call
a foreign method from within a call to wrenCall(). In other words,
foreign methods need to always be leaf calls on the call stack, but the
root of that stack can now come from runInterpreter() or wrenCall().

Fix #510.
2019-02-08 17:09:39 -08:00
Taylor Rose 193e0c812c Change size of label on line 449 to avoid incorrect compiler warning about label's maximum length 2018-12-19 09:38:26 -05:00
Taylor Rose 31e179907d Add support for home, end, delete, and ctrl+w 2018-10-31 18:32:34 -04:00
Will Speak a4b034f30b Fixup Handling of \ in REPL to Prevent Crash
When parsing the string token if a `\` was used it would
unconditionally consume the next character. This would led to a token
with an invalid lenght causing a crash when it was printed. This fixes
that by only consuming the token after the `\` if there is one to
consume.

Fixes #603
2018-10-08 07:35:55 +01:00
Jean-François Geyelin 8929415847 Remove unused prototype. 2018-09-27 15:03:10 +02:00
FICTURE7 fefed21158 Rename include guard 2018-07-27 18:57:17 +04:00
Michel Hermier fe57c1eea0 Trivial: wren_core.wren.inc needs to be regenerated. 2018-07-25 11:58:50 +02:00
Michel Hermier 051e224ce6 De-inline wrenHasError.
Move fiber error detection inside a function instead of using inlined
version everywhere.
2018-07-25 11:55:03 +02:00
Bob Nystrom 03ec25720d Add cast to satisfy the C++ warning gods. 2018-07-24 07:21:41 -07:00
Bob Nystrom f23c82071a Don't allow calling the root fiber.
The VM used to not detect this case. It meant you could get into a
situation where another fiber's caller had completed. Then, when it
tried to resume that fiber, the VM would crash because there was nothing
to resume to.

This is part of thinking through all the cases around re-entrancy. Added
some notes for that too.
2018-07-21 10:02:29 -07:00
Bob Nystrom 5f29a72d65 Remove the special method type for Fn.call(...).
Instead, using regular primitives for each of the call() methods.
Doesn't help performance (alas), but does seem cleaner to me.
2018-07-18 08:20:11 -07:00
Bob Nystrom 7a42a20b98 Merge branch 'master' into smarter-imports
# Conflicts:
#	src/module/io.c
#	src/vm/wren_vm.c
2018-07-15 21:01:14 -07:00
Bob Nystrom c367fc3bfc Get logical imports in "wren_modules" working.
There's a lot of changes here and surely some rough edges to iron out.
Also, I need to update the docs. But I want to get closer to landing
this so I can build on it.
2018-07-15 20:09:41 -07:00
Bob Nystrom 09f4beff4a Add trim methods on String:
- trim()
- trim(chars)
- trimEnd()
- trimEnd(chars)
- trimStart()
- trimStart(chars)
2018-07-15 10:48:56 -07:00
Bob Nystrom a3c2402ca0 Merge branch 'missing_undef' of https://github.com/dressupgeekout/wren into dressupgeekout-missing_undef
# Conflicts:
#	AUTHORS
2018-07-13 07:01:57 -07:00
Michał Kozakiewicz ad9a0e13ac Small improvements
* Safer definitions in io.c
* Easier to understand information in repl.wren
* Added my e-mail; Contributing > Hacking on the VM
2018-07-12 21:50:23 +02:00
Aleksi Salmela e7b1bade1a Check that there is space in local variable array
Otherwise it can overflow due to for loop's hidden
variables.

Fix #561
2018-06-13 00:59:55 +03:00
Charlotte Koch 18f74d89c4 Don't forget to #undef FINALIZER 2018-06-05 13:27:45 -07:00