Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BlockType.INLINE support #2 #220

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

yuri-kiss
Copy link

I deleted my head repo a while ago so I am remaking this pr (#217)

Resolves

Nothing is resolved this is just a new feature.

Proposed Changes

Adds BlockType.INLINE support in full (so compiler support)
This takes the second approach of #187 (comment)
And this PR can be used as a replacement for #187 itself.

Reason for Changes

The need for ugly inline patches and hacky thread stuff.

Test Coverage

No tests but I did try with a extension.

(function(Scratch) {
  class InlineBlockTest {
    getInfo() {
      return {
        id: 'InlineBlockTest',
        name: 'Test: Inline Block',
        blocks: [{
          blockType: Scratch.BlockType.INLINE,
          opcode: 'block',
          text: 'inline',
        }]
      }
    }
    async block(_, util) {
      await (Promise.resolve());
      util.startBranch(1, true); // Loop does not actually work like "loop"
      return 'test';
    }
  }
  Scratch.extensions.register(new InlineBlockTest);
})(Scratch);

@FurryR
Copy link

FurryR commented Oct 1, 2024

Can it be used for lambdas?

@yuri-kiss
Copy link
Author

Can it be used for lambdas?

technically yeah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants