theodore-norvell / PLAAY

Senior Design Project PLAAY (Programming Language for Adults And Youth)
2 stars 0 forks source link

Display of Tuples in the animator. #170

Closed theodore-norvell closed 5 years ago

theodore-norvell commented 6 years ago

On the display of the tuple nodes there are a few issues seen here

screen shot 2018-07-11 at 20 38 57

Compare with the HTML display

screen shot 2018-07-11 at 20 38 28

First, you can see that the blue box is dropped down. Second the comma placement is wrong in the horizontal direction.

For the display of values. I think you went off in the wrong direction. What I'd really like is that the tuples display recursively in place. Here is the same example part way through execution

screen shot 2018-07-11 at 20 40 26

There is no need to put the tuple values in a separate area. They should simply be put in place. So the declaration b would look a bit like this (I'm not showing the boxes that of course are there. The underlining indicates highlighting).

    con b :  := ( (42, "abc"), (2, 6, 4) )
In other words, apart from highlighting the values should look just the same as the nodes
did just before it was stepped.  After the next step, everything should look the same, except that whole declaration is highlighted. (Eventually I'll modify the the execution controller so it won't stop before the evaluation of tuples and certain other nodes where the display before and after the step is the same.)

Going back a few steps, the evaluation of the declaration of b will go like this
con b :  := ( ( 42, "abc" ), a )
                ~~

==Next==>

con b :  := ( ( 42, "abc" ), a )
                    ~~~~~

==Next==>

con b :  := ( ( 42, "abc" ), a )
              ~~~~~~~~~~~~~

==Next==>

con b :  := ( ( 42, "abc" ), a )
                             ~

==Next==>

con b :  := ( ( 42, "abc" ), ( 2, 6, 4 ) )
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                

==Next==>

con b :  := ( ( 42, "abc" ), ( 2, 6, 4 ) )
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

==Next==>

( )
(After I modify the execution controller, the animator won't stop before the first 3 and the second last of these steps.)

Over on the stack, the top stack frame should look sort of like this (again not showing all the boxes) before the initialization of b:
+--------------+
| a (2,6,4)    |
| b ⏚          |
+--------------+
After the initialization of b, it should look like this
+----------------------------+
| a (2,6,4)                  |
| b ((42, "abc"), (2, 4, 6)) |
+----------------------------+


Finally, the empty tuple should display as  ( ).
ajavij commented 6 years ago

This is fixed. Please review the changes.

theodore-norvell commented 5 years ago

All the above is implemented