Skip to content
N-J-Martin edited this page Feb 27, 2025 · 5 revisions

Conjure Blocks

A block-editor web app for essence built using blockly

Helpful blockly links

Common Issues

  • block not defined
    • this is likely caused by a change in block definition, so a block is stored in browser history that no longer exists.
    • to fix, comment out the load session line in serialization.js, and rerun to empty the workspace history. You can then uncomment once fixed.

Possible Next Steps

  • Automated testing
  • UX improvements

Currently working on

Automated Block Generation

(backtrack from this branch, in new branch).

Method:

  • Copy tree-sitter style grammar from here, remove outer grammar() and import.

  • Write definitions for other predefined functions as follows:

    • seq – formats arguments into message and arg list for block built from passed results. (main function for blocks)
    • Repeat – adds an input that only accepts blocks that output Arrays/list (for the repetition)
    • Choice – if all options are strings, then makes and block with the strings in a dropdown selection menu, otherwise gives the list of blocks that are part of the callers type. Used to determine input connection if argument of another function, otherwise is used to determine type inheritance and toolbox categories.
    • Optional – as optional, always assume yes, so just returns the argument. (possible use of mutators in future)
    • Prec – sets blocks precedence to number,
    • Prec.left and Prec.right - essentially ignored as blockly needs precedence number.
  • Defined regex blocks as value blocks that only accept regex

  • Implement variable category for typed variables