Thomas Weber
7b62efcb7f
ast: stop this script cannot yield anymore
2020-08-23 11:15:14 -05:00
Thomas Weber
9555b68381
js: Make retire() smarter
2020-08-23 11:14:49 -05:00
Thomas Weber
411dea526e
ast: operator_mathop is case insensitive
2020-08-22 23:48:10 -05:00
Thomas Weber
12c3484599
ast: stop this script only yields outside of procedure
2020-08-22 15:55:03 -05:00
Thomas Weber
0cdde43ea7
ast: Add missing yields sets
2020-08-22 14:51:04 -05:00
Thomas Weber
db3900ccfb
ast+js: Break up control.stop
2020-08-22 14:47:10 -05:00
Thomas Weber
1bcbd4bda5
js: Update generatorNameVariablePool
2020-08-22 14:18:58 -05:00
Thomas Weber
da87f66b11
ast: Cleanup analysis more
...
- dependency flattening is unnecessary
- fix not reanalyzing the same procedure twice
2020-08-22 14:16:32 -05:00
Thomas Weber
35b4e260f4
js: Use ast.procedures
2020-08-22 14:13:53 -05:00
Thomas Weber
657c1e390f
ast: uncompiledProcedures -> proceduresToCompile
2020-08-22 14:06:13 -05:00
Thomas Weber
ba8e7ea0dd
ast: Do not analyze procedures multiple times
2020-08-22 14:06:02 -05:00
Thomas Weber
646f30ca10
js: Cleanup handling of procedures
2020-08-22 14:03:40 -05:00
Thomas Weber
b07c8c5609
ast: Rewrite analysis
...
Analysis now also flattens the dependedProcedures list
2020-08-22 14:03:40 -05:00
Thomas Weber
f422b68ec9
Remove unused import
2020-08-22 14:03:40 -05:00
Thomas Weber
31cb5538c0
ast+js: Script analysis cleanup
2020-08-22 14:03:40 -05:00
Thomas Weber
77103e8e23
ast+js: Script analysis prototype
...
AST generation tracks more information about yields.
This is used to generate non-generator functions when possible.
2020-08-22 14:03:40 -05:00
Thomas Weber
b93eeed3f0
Remove unused script variable const t
2020-08-22 01:21:42 -05:00
Thomas Weber
2c7a3d299f
Rename some internal opcodes
...
sensing.keydown -> keyboard.pressed
sensing.mousedown -> mouse.down
sensing.mouseY -> mouse.y
sensing.mouseX -> mouse.x
sensing.timer -> timer.get
sensing.resetTimer -> timer.reset
2020-08-22 00:58:02 -05:00
Thomas Weber
79fb3f9005
Reset cache when modifying comments, as these can affect compilation
2020-08-22 00:34:41 -05:00
Thomas Weber
39f8b2dfd3
Merge branch 'develop' of https://github.com/llk/scratch-vm into develop
2020-08-20 20:23:29 -05:00
Eric Rosenbaum
c6962cb390
Merge pull request #2542 from apple502j/video-motion-fix
...
Use new updateCPURenderAttributes in video sensing
2020-08-20 17:11:46 -04:00
Thomas Weber
74e499085f
Hard code SCALAR_TYPE and LIST_TYPE
2020-08-19 22:28:55 -05:00
Thomas Weber
0b1cbbf6e4
VM execute doesn't need to check for isCompiled as it is already checked everywhere it's used
2020-08-19 16:21:30 -05:00
Thomas Weber
d477e8ef95
js: We have to search all sprites for a costume, not just the current target.
2020-08-16 22:11:10 -05:00
Thomas Weber
b2d920485f
Fix non-letter keys
2020-08-14 18:06:40 -05:00
Thomas Weber
6083f4dcd7
Expose last key pressed to scripts
2020-08-14 18:04:55 -05:00
Thomas Weber
0c3f24f496
Track last key pressed
2020-08-14 18:04:47 -05:00
Thomas Weber
c9dab2fd8a
Improve Scratch 2 hacked keyboard sensing block compatibility
...
Enter, escape
2020-08-14 17:56:09 -05:00
Thomas Weber
11242c9f44
Add more keys to key sensing ( #9 )
...
Backspace, delete, shift, control, escape
2020-08-14 17:55:20 -05:00
Thomas Weber
faaf4a7d0d
Do not compile scripts running from toolbox
...
Regression from astgen rewrite.
2020-08-14 17:28:38 -05:00
Thomas Weber
2ab47ec681
Merge branch 'develop' of https://github.com/llk/scratch-vm into develop
2020-08-13 17:24:36 -05:00
Thomas Weber
ec895db09a
Cleanup some older changes
2020-08-13 17:24:28 -05:00
Thomas Weber
20f1012961
Add stuck checking option
2020-08-13 17:17:35 -05:00
Thomas Weber
bcfeef474c
ast: Mark various methods and properties as private
2020-08-13 17:16:41 -05:00
Thomas Weber
d9bb8250ac
execute: Only check for stuck every 10th call
...
This improves performance by not checking quite so often.
2020-08-13 00:21:10 -05:00
Thomas Weber
1ee93db394
js: add checkStuckInLoop for further testing of stuck detection in loops
2020-08-13 00:19:20 -05:00
Thomas Weber
5aff90af0d
js: Improve yieldNotWarpOrStuck
2020-08-13 00:04:51 -05:00
Thomas Weber
a68665b542
ast: Don't create the variable in the original if it already exists
...
It may have been created in the original between when this sprite was cloned and when this script is compiled.
2020-08-12 16:59:38 -05:00
Thomas Weber
01e79ea337
ast: Improve clone variable creation
...
Only need to look through the sprite's clones, not every sprite.
2020-08-12 16:58:37 -05:00
Thomas Weber
a9f9ac7dc7
ast: Fix variables created by clones not being added to the original
...
This fixes https://scratch.mit.edu/projects/416410318/editor/
A clone could previously create a variable only in that clone, and that would break things because the cached result would be reused on other clones where it might not exist.
2020-08-12 01:46:11 -05:00
Thomas Weber
05aef80288
ast: Remove unnecessary double variableCache setting
2020-08-12 01:45:09 -05:00
Thomas Weber
d0e2987cb7
ast: Simplify compiler detector logic, fix default value for boolean arguments
2020-08-10 17:20:54 -05:00
Thomas Weber
4c6225a5ca
js: Simplify yieldNotWarpOrStuck
2020-08-09 15:00:38 -05:00
Thomas Weber
1170d4add6
execute: Address some compatibility layer todos
...
- handle warp mode
- handle promise return value after yield
2020-08-09 14:15:16 -05:00
Thomas Weber
9f6cd4244d
js: Wait should check for stuck
2020-08-09 14:14:45 -05:00
Thomas Weber
05305af250
execute: timer should use runtime.currentMSecs
2020-08-09 14:14:27 -05:00
Thomas Weber
2fc50f3dbc
js/execute: Improve stuck detection
...
- move logic to execute
- only check for stuck if in warp
2020-08-09 14:12:55 -05:00
Thomas Weber
0447835bc7
execute: Fix some compatibility layer timing bugs ( #8 )
2020-08-08 22:43:27 -05:00
Thomas Weber
e5b252502f
js: control.wait should request a redraw ( #8 )
2020-08-08 22:14:13 -05:00
Thomas Weber
b9f24c349d
js: Don't include opcode comment in compat layer
...
Already included when getting the opcode function.
2020-08-08 22:04:15 -05:00