oleobal / rockstar-interpreter

A Python interpreter for the Rockstar programming language
GNU General Public License v3.0
0 stars 0 forks source link

Broken blocks #6

Closed oleobal closed 6 years ago

oleobal commented 6 years ago

Conditional update broke blocks. By which I mean, test-blocks and test-blocks-2 don't work anymore.

In test-blocks, the instruction :

If my heart is true
Say "Hello"

Is translated into

[{'type': 'flow control', 'value': 'If'},
 {'type': 'variable', 'value': 'my heart'},
 {'type': 'comparator', 'value': 'EQ'},
 {'type': 'block',
  'value': [[{'type': 'operator', 'value': 'say'},
             {'type': 'string', 'value': 'Hello'}]]}]

Where, obviously, a token is missing (the expression to the right of EQ). This causes processConditionalExpression to fail by calling evaluate on a print instruction.

zebralt commented 6 years ago

Fixed by commit 73275ae6a586b1b98faaf6f26bbce3d73a80c865.