Dummy is an artifact of the way I imagined the UI would work, as you could only add an assigned variable if you have added a node for that value first.
Empty would have worked just as well. The idea was that as you attach new nodes to one node, you could enter new variables for the assigned-to side. You should have at least as many RHS nodes attached as you have variables assigned. The UI would not let you insert dummy nodes in the output of an assignment node (or a for...in node) before others that are not dummy.
Code: Select all
--[[ For example: ]]--
local a, b, c, d = e, f
--[[ would translate to:
+-------------------+
| Local assignment |
| .
| [a] o---- [Expression [e] ]
| .
| [b] o---- [Expression [f] ]
| .
| [c] o---- [Dummy/Empty]
| .
| [d] o---- [Dummy/Empty]
| .
| |
+-------------------+
while something like
--]]
local a, b = c, d, e, f
--[[ would translate to:
+-------------------+
| Local assignment |
| .
| [a] o---- [Expression [c] ]
| .
| [b] o---- [Expression [d] ]
| .
| [ ] o---- [Expression [e] ]
| .
| [ ] o---- [Expression [f] ]
| .
| |
+-------------------+
--]]
The little circles in the original picture (I drew them far too small, sorry), and the dots in the above, are insertion points: when you attach a line there, it is promoted to a new circle that keeps the same position as where you inserted, and dots are created as well around it. And every circle on the right side of a local assignment has an associated assigned-to variable (you can leave the field empty to not add a variable, as in the a,b=c,d,e,f case). Hope it's clearer now what role the dummies are fulfilling.
Edit: Anyway, in the end it doesn't matter. While the AST approach is appealing for the UI coder because of the simplicity of coding it, it's really not very practical for the user of the UI, and as Nicholas has noted, an approach where the program flow "follows the arrows" instead of being top to bottom, would be much more intuitive for the user. I just still have my reservations about its universality and applicability to LÖVE.