Commit graph

2347 commits

Author SHA1 Message Date
Jordan Eldredge
1ecab48bdf Get the first set of internal state right away 2019-11-30 13:42:53 -08:00
Jordan Eldredge
c135cf91a6 Move paused into the reducer 2019-11-30 13:42:53 -08:00
Jordan Eldredge
5cba75f4b8 Don't resume on removing a breakpoint 2019-11-30 13:42:53 -08:00
Jordan Eldredge
d2e27b0349 Rewrite the debugger to use the generator approach to pausing code 2019-11-30 13:42:53 -08:00
Jordan Eldredge
aa54ee33e0 Add the ability to inject a command handler into the interpreter 2019-11-30 13:42:53 -08:00
Jordan Eldredge
e66726f02a Make the VM a generator 2019-11-30 13:42:53 -08:00
Jordan Eldredge
0e059efe99 Make the VM sync 2019-11-30 13:42:53 -08:00
Jordan Eldredge
21caf927c7 Consolidate maki and mordern skin reference files 2019-11-30 13:42:53 -08:00
Jordan Eldredge
7bede9cd5a Improve parser tests
Ensure we can parse all scripts and move the parser tests to a parser test file for clarity
2019-11-30 13:42:53 -08:00
Jordan Eldredge
6b03a353e7 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-11-30 13:42:53 -08:00
Jordan Eldredge
c61fbb952d Move offset mapping entirely into the parser 2019-11-30 13:42:53 -08:00
Jordan Eldredge
8529d948ec Assert which files get read from the zip 2019-11-30 13:42:53 -08:00
Jordan Eldredge
ab6c1264fd Introduce asyncDepthFirstFlatMap 2019-11-30 13:42:53 -08:00
Jordan Eldredge
97561b0045 Prettier 2019-11-30 13:42:53 -08:00
jberg
1ab5a9d0d7 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-11-30 13:42:53 -08:00
jberg
c55babadd6 lookup command opcodes in debugger (#817) 2019-11-30 13:42:53 -08:00
dependabot[bot]
4a0c1e4a7a 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-11-30 13:42:53 -08:00
Jordan Eldredge
2cfec69c66 Add comments in places where we await because of #814 2019-11-30 13:42:53 -08:00
Jordan Eldredge
72ef987112 Clean up test format 2019-11-30 13:42:53 -08:00
Jordan Eldredge
423267a9c0 Remove try/catch blocks
There were only here so that we could check in the tests before the code actually worked
2019-11-30 13:42:53 -08:00
Jordan Eldredge
d6c88039cf Use signed ints for function offsets 2019-11-30 13:42:53 -08:00
Jordan Eldredge
b61ca9f791 Consolidate cases that get a variable offset 2019-11-30 13:42:53 -08:00
Jordan Eldredge
39b7063b5b Make it more clear that func and line get the same info 2019-11-30 13:42:53 -08:00
Jordan Eldredge
f5d080dcf7 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-11-30 13:42:53 -08:00
Jordan Eldredge
19c24d18f9 Remove unused data about localFunctions 2019-11-30 13:42:53 -08:00
Jordan Eldredge
585b75ae4e Inline readUInt32LE
This will allow us to do signed ints in some places but not all.
2019-11-30 13:42:53 -08:00
Jordan Eldredge
5dab717425 Prettier 2019-11-30 13:42:53 -08:00
Jordan Eldredge
326c37d149 Add utility function for getting binary arrays out of zips 2019-11-30 13:42:53 -08:00
Jordan Eldredge
81fa6010e8 Avoid annoying message when running yarn commands 2019-11-30 13:42:53 -08:00
jberg
137e78e688 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-11-30 13:42:53 -08:00
Jordan Eldredge
3105ab1372 Move runtime to toplevel 2019-11-30 13:42:53 -08:00
Jordan Eldredge
2a9376e018 Add messages section 2019-11-30 13:42:53 -08:00
Jordan Eldredge
0690f8cf8d Pause before the first command 2019-11-30 13:42:53 -08:00
jberg
d0ceda1520 fix button image rendering and handle layout without x/y (#812) 2019-11-30 13:42:53 -08:00
Jordan Eldredge
62bb17188d Speed up running scripts in the debugger 2019-11-30 13:42:53 -08:00
jberg
a925bfc31e 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-11-30 13:42:53 -08:00
jberg
d6f9ce8351 tweak 2 arg operatores and coercion (#810) 2019-11-30 13:42:53 -08:00
Jordan Eldredge
005629f9e9 Abstract how we handle two argument operators.
Some don't work. I wonder why.
2019-11-30 13:42:53 -08:00
Jordan Eldredge
3798934615 Don't log the "done" promise 2019-11-30 13:42:53 -08:00
Jordan Eldredge
05362da4a3 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-11-30 13:42:53 -08:00
Jordan Eldredge
5a7489db4e Commands only have a single argument 2019-11-30 13:42:53 -08:00
jberg
e015c15625 fix tests, sprinkle more async/await (#809) 2019-11-30 13:42:53 -08:00
jberg
f56d44cbb8 remove integer checking (#808) 2019-11-30 13:42:53 -08:00
Jordan Eldredge
fb14ae9a00 Run prettier 2019-11-30 13:42:53 -08:00
jberg
4c06a38d46 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-11-30 13:42:53 -08:00
Jordan Eldredge
0187838132 Reference correct skin in utils test 2019-11-30 13:42:53 -08:00
jberg
e8e49103a9 simplify type coercion / fix destructuring related error (#807) 2019-11-30 13:42:53 -08:00
jberg
9007b1c4ee More basic tests (#805)
* add more basic tests

* add/update passing test strings

* only coerce if int is on LHS
2019-11-30 13:42:53 -08:00
jberg
1146ce4758 implement more operators and coerce types (#804)
* implement more operators and coerce types

* add remaining operators
2019-11-30 13:42:53 -08:00
Jordan Eldredge
8e0f50a2e6 Fix initial paused state 2019-11-30 13:42:53 -08:00