Closed gregtour closed 9 years ago
like this?
<if> ::= if <condition> then <endl> <stmt list> <else if>
<else if> ::= else <endl> <stmt list> end
<else if> ::= else <if>
<else if> ::= end
This CFG seemed to pass all my tests so I merged it into the grammar and rebuilt the interpreter.
This has been a long time coming. The Duck grammar file needs to be updated to support blocks like the following:
if condition then /* code statements _/ else if othercondition then / code statements / else // optional / code statements */ end