Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@
<link rel="stylesheet" href="css/themes.css">
<script src="lib/easeljs.min.js" defer></script>
<script src="lib/tweenjs.min.js" defer></script>

<script>
let ast2blocklist_config;
fetch("js/js-export/ast2blocks.min.json")
.then(response => response.json())
.then(data => { ast2blocklist_config = data })
</script>
</head>

<body id="body" onload="init();" data-title="index" style="background: #f9f9f9;">
Expand Down
Binary file added js/js-export/AST_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions js/js-export/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ The code corresponding to the JavaScript Editor widget is in
* `generate.js` — contains the utilities for generating code from the
block stacks.

* `ast2blocklist.js` - contains the utilities for generating blocks from the code in the editor

* `ast2blocks.json` - contains the block configurations for code to block conversion.
For detailed information on how to add blocks for code to block support see `./conversion_config_guide.md`

* `ASTutils.js` — contains the utilities for generating the *Abstract
Syntax Tree* (*AST*) in `ESTree` specification, for the corresponding
code to the block stacks. Used by `JSGenerate` class in `generate.js`.
Expand Down
626 changes: 550 additions & 76 deletions js/js-export/__tests__/ast2blocklist.test.js

Large diffs are not rendered by default.

Binary file added js/js-export/argument_AST_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added js/js-export/argument_block.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added js/js-export/argument_vspace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added js/js-export/argument_with_argument.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,540 changes: 519 additions & 1,021 deletions js/js-export/ast2blocklist.js

Large diffs are not rendered by default.

Loading