xtclang / xvm

Ecstasy and XVM
Other
195 stars 15 forks source link

Fix a compiler bug #223

Closed ggleyzer closed 1 month ago

ggleyzer commented 1 month ago

Cliff reported a compiler bug: failure to compile a nested ternary:

conditional String test(Boolean b0, Boolean b1) {
    return b0
        ? (b1 ? False : (True,"def"))
        : (b1 ? (True,"abc") : (True, "xyz"));
}

This change fixes it as well as simplifies the BAST production of ReturnStatement

cpurdy commented 1 month ago

@cliffclick A few small changes will show up in a minute from a zoom review I did with @ggleyzer .