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 dictionary variables and related blocks #22

Merged
merged 13 commits into from
May 11, 2019
Merged

Add dictionary variables and related blocks #22

merged 13 commits into from
May 11, 2019

Conversation

tansly
Copy link
Contributor

@tansly tansly commented Apr 12, 2019

See also FBDY/bb-vm#50.

TODO:

  • See the commented out lines:
    Blockly.DataCategory.addAddToDict(xmlList, firstVariable);
    Blockly.DataCategory.addSep(xmlList);
    // Blockly.DataCategory.addDeleteOfList(xmlList, firstVariable);
    // Blockly.DataCategory.addDeleteAllOfList(xmlList, firstVariable);
    // Blockly.DataCategory.addInsertAtList(xmlList, firstVariable);
    // Blockly.DataCategory.addReplaceItemOfList(xmlList, firstVariable);
    Blockly.DataCategory.addSep(xmlList);
    Blockly.DataCategory.addItemOfDict(xmlList, firstVariable);
    // Blockly.DataCategory.addItemNumberOfList(xmlList, firstVariable);
    // Blockly.DataCategory.addLengthOfList(xmlList, firstVariable);
    // Blockly.DataCategory.addListContainsItem(xmlList, firstVariable);
    Blockly.DataCategory.addSep(xmlList);
    Blockly.DataCategory.addShowDict(xmlList, firstVariable);
    Blockly.DataCategory.addHideDict(xmlList, firstVariable);

    Determine which of these operations are applicable to dictionaries and implement the ones which are. -> Implemented the ones that I think are suitable.
  • Check this out:
    /**
    * XXX: This is copied from the mixin for the list context menu.
    * I've modified it without paying much attention so beware.
    * TODO: Inspect this in detail.
    * Make sure the stuff about variable renaming, deletion etc. work properly.

    I vaguely remember testing this stuff but I'm not sure. Remove the comments when sure.
  • Review block messages for understandability.
  • for key in dict block?
  • Polish for key in dict block, fix the non-existent field warning -- will deal with this later

Includes:
* "Make a Dictionary" button in the toolbox.
* Code for variable creation and name validation for dictionary type.
* Related messages in msg/.
@tansly tansly added the enhancement New feature or request label Apr 12, 2019
@tansly tansly self-assigned this Apr 12, 2019
core/data_category.js Outdated Show resolved Hide resolved
@tansly
Copy link
Contributor Author

tansly commented Apr 12, 2019

Now, there is the long work of adding related blocks one by one... Then comes the VM work for their execution at FBDY/bb-vm#51.

@tansly
Copy link
Contributor Author

tansly commented Apr 15, 2019

At this point it seems like a good idea to work on FBDY/bb-vm#51 in parallel to this. At least testing the add/get blocks would be nice.

blocks_vertical/data.js Outdated Show resolved Hide resolved
core/data_category.js Outdated Show resolved Hide resolved
core/data_category.js Show resolved Hide resolved
@tansly tansly changed the title [WIP] Add dictionary variables and related blocks Add dictionary variables and related blocks May 11, 2019
@tansly tansly merged commit 357be4c into develop May 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant