Commit Graph
2731 Commits
Author SHA1 Message Date
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
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
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
Thomas Weber fa34aa9f6a Remove target global from executor
Just get it from thread
2020-07-07 13:45:47 -05:00
Thomas Weber 4c9eccf536 Convert some strings to numbers for performance 2020-07-07 13:44:58 -05:00
Thomas Weber a5536bfa3c Move script cache to Blocks 2020-07-07 11:05:46 -05:00
Thomas Weber d5546c6b05 dirty hack to fix some wrongful caching 2020-07-06 23:44:49 -05:00
Thomas Weber c6b9df757c Script factories 2020-07-06 23:18:16 -05:00
Thomas Weber da1c8e6abe implement a few more blocks
- looks_size
- motion_direction
- sensing_username
2020-07-06 23:17:40 -05:00
Thomas Weber f0d76864a4 minor cleanup 2020-07-06 23:16:51 -05:00
Thomas Weber d27cc02bae optimizations, bug fixes 2020-07-06 22:13:48 -05:00
Thomas Weber 5c56ba025a transition more things to yielding 2020-07-06 20:42:16 -05:00
Thomas Weber bf32e2e468 Back to a yielding compiler 2020-07-06 19:34:38 -05:00
Thomas Weber 5bec779b4a minor optimizations/fixes 2020-07-06 18:23:16 -05:00
Thomas Weber 3bfc252a0e fix a couple small bugs 2020-06-26 14:44:19 -05:00
Thomas Weber fdad50f397 Get some more things to work in the compiler
- add event_broadcastandwait
- add looks_switchbackdropto
- add looks_backdrops
2020-06-26 12:45:06 -05:00
Thomas Weber 1714ebf5f6 Merge remote-tracking branch 'upstream/develop' into develop 2020-06-26 00:45:18 -05:00
Thomas Weber 930fe68112 More updates to the compiler
- remove unused local variable tracking and utilities
- add some jsdoc to the compiler executor
- improve variable reference finding
- add data_listcontainsitem
- add event_broadcast
- add event_broadcast_menu
2020-06-26 00:14:42 -05:00
Thomas Weber ae5ce527b1 Some smaller bug fixes in the compiler
- throw if toString on asNumber, asString, asBoolean
- log compilation errors again
- add motion_setrotationstyle
- fix operator_divide NaN handling
- fix operator_mod second argument
2020-06-25 23:05:06 -05:00