Commit Graph
3720 Commits
Author SHA1 Message Date
Thomas Weber 093dd56cc8 Don't use uglify 2020-07-25 13:40:17 -05:00
Thomas Weber 2d25c505f5 Only change warp status in warp procedures
Warp incrementing and decrementing is now only included for warp procedures.
Non-warp procedures do not touch the counter at all.
2020-07-17 22:05:32 -05:00
Thomas Weber 8b90a356eb Fix list contains, list index of 2020-07-17 18:08:24 -05:00
Thomas Weber 099295a89f Modernize browser targets 2020-07-16 18:43:11 -05:00
Thomas Weber b027b7d50c Use specialized methods for comparisons
Remove the generalized `cast` in favor of 3 specialized ones.
This is a slight optimizations for comparisons.
2020-07-16 16:38:19 -05:00
Thomas Weber 4d5a7b70f3 Remove unused runtime method toString 2020-07-16 16:35:27 -05:00
Thomas Weber 5c032876b3 Optimize operator_random for the common case of constant bounds 2020-07-16 16:05:49 -05:00
Thomas Weber 8396d9f41f Allow inputs to be marked as constant 2020-07-16 16:05:00 -05:00
Thomas Weber c79505f8ee Add type hints for InputUtil 2020-07-16 16:04:27 -05:00
Thomas Weber 4f97ba73b9 Optimize Cast.isInt
This probably belongs upstream.
2020-07-16 15:54:03 -05:00
Thomas Weber 0b4ce41f12 Cleanup 2020-07-16 13:50:55 -05:00
Thomas Weber 0ff1f0f6b6 Merge remote-tracking branch 'upstream/develop' into develop 2020-07-14 23:54:08 -05:00
Thomas Weber e0a375bfc8 compile looks_backdropnumbername 2020-07-14 19:21:13 -05:00
Thomas Weber 14bf8d88ce compile pen_setPenHueToNumber 2020-07-14 19:09:39 -05:00
Thomas Weber c141be971d createScriptFactory -> scopedEval 2020-07-14 18:55:02 -05:00
Thomas Weber ed5e0bd40b Move constants around, simplify block imports 2020-07-14 17:35:46 -05:00
Thomas Weber 259f5f32fd Further refactoring 2020-07-14 17:21:37 -05:00
Thomas Weber 784f94a145 Fixing imports, organizing, refactoring 2020-07-14 16:37:43 -05:00
Thomas Weber 45b9a977f1 Break the compiler up into a lot more smaller pieces 2020-07-14 16:32:26 -05:00
Thomas Weber 1424678c6c reset stack frames with the warp status 2020-07-14 15:50:33 -05:00
Thomas Weber f2b2c98c25 More refactoring 2020-07-14 15:44:39 -05:00
Thomas Weber 84e14d5261 Refactoring 2020-07-14 15:29:52 -05:00
Thomas Weber 2c1f1bdf0d Add some missing "used by compiler" annotations
the point is if upstream ever changes these, git will get really upset about merge conflicts and make sure nothing silently breaks
2020-07-14 14:47:54 -05:00
Thomas Weber b88cdde672 Add a way to disable compiler on a script 2020-07-14 14:45:26 -05:00
Thomas Weber a9c3982d30 Move list contents into compiler 2020-07-14 14:44:57 -05:00
Thomas Weber ce3338f334 Move looks effects blocks into compat layer 2020-07-14 14:44:35 -05:00
Thomas Weber 818ce8e9b9 Move all the "touching color" blocks into the compiler 2020-07-14 14:43:48 -05:00
Chris Willis-Ford a9f473feb6 Merge pull request #2476 from cwillisf/fix-extension-url
sanitize extension ID in getExtensionIdForOpcode
2020-07-14 11:47:02 -07:00
Thomas Weber 71b6012f72 include some extra debug info in compat layer calls 2020-07-14 12:51:55 -05:00
Thomas Weber 2a12e70dce Fix some more compiler bugs
- add data_itemnumoflist
- fix compatibility layer operator precedence issues
- don't cache procedures until compilation completed
2020-07-14 12:45:38 -05:00
Thomas Weber ea6c177b6f Simplify change variable by 2020-07-14 01:44:48 -05:00
Thomas Weber 7dba04525d Fix restarted threads not being compiled 2020-07-14 01:44:30 -05:00
Thomas Weber 1c0b3c9088 Remove targetVariables, stageVariables aliases
Now redundant, only adds useless runtime data.
2020-07-14 00:22:26 -05:00
Thomas Weber f844f234fe remove some duplicates from compat 2020-07-14 00:15:33 -05:00
Thomas Weber 9dfbdba2d3 Factory variables
Variables that are evaluated once, at compile-time.
Makes every variable access even faster than before.
Implementation a bit dirty, will clean up later.
2020-07-13 23:52:18 -05:00
Thomas Weber 22a80d579e warn on duplicate opcodes 2020-07-13 23:46:42 -05:00
Thomas Weber e1aef16944 Simplify type conversions
It turns out that calling a function to do this this every time is rather slow, so we manually inline number and string conversions.
Boolean conversions are complex enough that I don't think inlining it would be a very good idea.
2020-07-13 23:45:20 -05:00
Thomas Weber c5519634d4 Increase amount of blocks supported by compat layer
Haven't tested most of them, just hoping they work
2020-07-13 23:31:15 -05:00
Thomas Weber e3e467365e More compiling, less interpreting
- cache procedure compiling
- add more blocks to compat
- compile more blocks
- apparently the NUM field in numbers can be a real number sometimes
2020-07-13 20:12:16 -05:00
Thomas Weber d537a9b36b Make the forkphorus test suite (mostly) pass
- support fields in compatibility layer
- fix "last" of list
- add compiled control_for_each
- add compiled operator_contains
- round sin/cos, implement tan
- do not compile edge activated hats
2020-07-13 19:39:44 -05:00
Thomas Weber 7e767ad6fd Fix some more bugs
- update readme to be more up-to-date
- fix compatibility layer stack frame handling
- fix broadcasting non-strings
- compile some more blocks
- add some more blocks to the compatibility layer
2020-07-13 19:00:04 -05:00
Thomas Weber e23f29c798 Improve the compiler compatibility layer 2020-07-13 18:04:38 -05:00
Thomas Weber fd0795d285 WIP "compatibility layer" to use some blocks from scratch-vm in compiled scripts 2020-07-13 17:16:31 -05:00
Thomas Weber fa5cf0bad3 cleanup generator threads when retired 2020-07-09 13:29:40 -05:00
Thomas Weber 6a1f565759 fix list delete 2020-07-09 13:27:16 -05:00
Thomas Weber 57d8f9019f fix list insert 2020-07-09 13:16:40 -05:00
Eric Rosenbaum 540eaf6b8b Merge pull request #2509 from KisaragiEffective/patch-1
Fix document type in scratch3_data.js
2020-07-09 13:29:01 -04:00
Thomas Weber aed4aceaa9 Don't store generator result 2020-07-07 14:45:04 -05:00
Thomas Weber fd03197786 fix list contains 2020-07-07 14:44:49 -05:00
Thomas Weber 74ca976d2b fixup script stopping blocks 2020-07-07 14:44:22 -05:00