code-dot-org/blockly — pull request #750 by Bjvanminnen (2014-07-16 17:07:33+00:00)
Title: toggle whether we check blocks children or not

There are a few noteworthy scenarios when dealing with required blocks
(1) The case where we have numerical purple blocks. For example, "Move forward [100] pixels" where the 100 is a child block. If we have this as a required block, when checking user blocks we want to check the block (move forward) and it's children (100).
(2) The case where we have an if block as a required block. In this case, if we have a user block with a child (for example "if (flower) { get nectar; }") we want to test only the parent block against the required block.

To accomplish this, I've brought back the temporary block creation that we used to have. It was problematic because it would rename some fields (i.e. function names), but that's okay here because I'm only using it to check to see if our required block has children. If the required block has children, we're going to compare everything. If our required block does not have any