Commit graph

2350 commits

Author SHA1 Message Date
Jordan Eldredge
cf09ea75d7
Start sketching out initialization (#815) 2019-07-31 15:13:55 -07:00
Jordan Eldredge
18e198a13f Clean up and document the generator approach 2019-07-23 23:49:20 -07:00
Jordan Eldredge
7b3026e5fb Unwrap program 2019-07-23 20:23:46 -07:00
Jordan Eldredge
d30e0a6f5f Get the first set of internal state right away 2019-07-23 20:00:54 -07:00
Jordan Eldredge
19781e334a Move paused into the reducer 2019-07-23 19:58:11 -07:00
Jordan Eldredge
3d876c57f2 Don't resume on removing a breakpoint 2019-07-23 19:55:01 -07:00
Jordan Eldredge
f58f994a99 Rewrite the debugger to use the generator approach to pausing code 2019-07-23 19:54:01 -07:00
Jordan Eldredge
c03783eb39 Add the ability to inject a command handler into the interpreter 2019-07-23 19:53:29 -07:00
Jordan Eldredge
1c240e927e Make the VM a generator 2019-07-23 17:02:02 -07:00
Jordan Eldredge
41553c5a85 Make the VM sync 2019-07-23 16:53:20 -07:00
Jordan Eldredge
0e1f94b245 Consolidate maki and mordern skin reference files 2019-07-20 21:28:35 -07:00
Jordan Eldredge
cd2f8e71f6 Improve parser tests
Ensure we can parse all scripts and move the parser tests to a parser test file for clarity
2019-07-20 18:39:43 -07:00
Jordan Eldredge
028858e7a3
Inline includes (#819)
* Inline includes

Rather than making the content of the included file the _contents_ of
the `<include />` node, we replace the `<include />` node with the
children of the included file.

* Use asyncTreeFlatMap instead of asyncTreeMap

FlatMap is more powerful than map. More importantly, I only want to maintain one tree map function if I can help it.
2019-07-20 18:33:21 -07:00
Jordan Eldredge
d4634d7df6 Move offset mapping entirely into the parser 2019-07-20 18:18:19 -07:00
Jordan Eldredge
d99f8c1f9d Assert which files get read from the zip 2019-07-20 17:01:27 -07:00
Jordan Eldredge
76e472acac Introduce asyncDepthFirstFlatMap 2019-07-20 17:01:27 -07:00
Jordan Eldredge
d12bbcadd1 Prettier 2019-07-20 17:01:27 -07:00
jberg
06f3a473ed Add runtime version and remove version check hacks (#818)
* add runtime version and remove version check hacks

* move jump logic into a shared function
2019-07-20 16:39:19 -07:00
jberg
3cfd9278c8 lookup command opcodes in debugger (#817) 2019-07-20 16:26:17 -07:00
dependabot[bot]
c8ec4e4e54 Bump lodash from 4.17.11 to 4.17.13 (#816)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.13.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.13)

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-20 06:02:17 -07:00
Jordan Eldredge
386d46bcd7 Add comments in places where we await because of #814 2019-07-19 22:03:59 -07:00
Jordan Eldredge
9f04b71609 Clean up test format 2019-07-19 21:59:24 -07:00
Jordan Eldredge
3debd3704e Remove try/catch blocks
There were only here so that we could check in the tests before the code actually worked
2019-07-19 21:49:16 -07:00
Jordan Eldredge
ea3a7b4736 Use signed ints for function offsets 2019-07-19 21:46:38 -07:00
Jordan Eldredge
2cd23e7b14 Consolidate cases that get a variable offset 2019-07-19 21:38:25 -07:00
Jordan Eldredge
b44c825acb Make it more clear that func and line get the same info 2019-07-19 21:36:17 -07:00
Jordan Eldredge
ad4c95d602 Don't leak data from constants outside of the parserEventually we will get rid of the object in constants, so we don't want others to expect this data to be here. 2019-07-19 21:34:42 -07:00
Jordan Eldredge
aaf490b143 Remove unused data about localFunctions 2019-07-19 21:28:20 -07:00
Jordan Eldredge
2c62e419a7 Inline readUInt32LE
This will allow us to do signed ints in some places but not all.
2019-07-19 21:07:53 -07:00
Jordan Eldredge
5cc12d4464 Prettier 2019-07-19 20:59:20 -07:00
Jordan Eldredge
8b5e0204b9 Add utility function for getting binary arrays out of zips 2019-07-19 20:59:14 -07:00
Jordan Eldredge
e887733143 Avoid annoying message when running yarn commands 2019-07-19 20:58:47 -07:00
jberg
5343180181 more function and scope tests (#813)
* more function and scope tests

* hack to fix handling of wrong sign offsets

* attempting to fix async issue

* fixes captbaritone found

* add comment about recursive function
2019-07-18 15:40:00 -07:00
Jordan Eldredge
7d76a5762b Move runtime to toplevel 2019-07-16 18:48:02 -07:00
Jordan Eldredge
31a6a26bab Add messages section 2019-07-16 18:48:02 -07:00
Jordan Eldredge
fe569b8d0b Pause before the first command 2019-07-16 18:48:02 -07:00
jberg
ac31fb6801 fix button image rendering and handle layout without x/y (#812) 2019-07-16 18:47:26 -07:00
Jordan Eldredge
333bebee07 Speed up running scripts in the debugger 2019-07-15 07:30:38 -07:00
jberg
fdef7b8897 measure image if we don't have node attributes to use (#811)
* measure image if we don't have node attributes to use

* return image, allow for x/y to be specificied without w/h
2019-07-14 22:36:17 -07:00
jberg
e0036cba81 tweak 2 arg operatores and coercion (#810) 2019-07-14 17:16:56 -07:00
Jordan Eldredge
a1c49d2003 Abstract how we handle two argument operators.
Some don't work. I wonder why.
2019-07-14 15:55:04 -07:00
Jordan Eldredge
32534992ac Don't log the "done" promise 2019-07-14 15:45:20 -07:00
Jordan Eldredge
50fdc8529d Be consistent with ordering of a and b, even when it does not matter
Interestingly this changes the order of << but tests still pass
2019-07-14 15:45:04 -07:00
Jordan Eldredge
4330331082 Commands only have a single argument 2019-07-14 15:41:33 -07:00
jberg
7ba86cf584 fix tests, sprinkle more async/await (#809) 2019-07-14 15:25:40 -07:00
jberg
ea7b2d7670 remove integer checking (#808) 2019-07-13 19:00:04 -07:00
Jordan Eldredge
b73f9117dd Run prettier 2019-07-13 15:57:03 -07:00
jberg
a9fb8631c5 add simple function tests, run wa5 tests (#806)
* add simple function tests

* add simple functions to test suite

* add popTo/callGlobal definitions

* use interpret for callGlobal, pass stack to interpret

* type check and cast to int when setting variables

* need to await interpret calls

* get wa5 tests running

* add some comments
2019-07-13 15:45:32 -07:00
Jordan Eldredge
e6f67cf6f5 Reference correct skin in utils test 2019-07-13 15:37:57 -07:00
jberg
c0caa5fa60 simplify type coercion / fix destructuring related error (#807) 2019-07-12 15:29:14 -07:00