Add "elif" statement

Bug #872685 reported by Matt Giuca
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mars
Fix Committed
Low
Matt Giuca

Bug Description

Mars does not have any "else if" notion, which makes chained conditional blocks very hard to read. Obviously, C-syntax languages do not have an "else if" either; it is just implicit in the syntax:

if (...)
{
    ...
}
else if (...)
{
    ...
}
else
{
    ...
}

But in Python-syntax languages, such as Mars, this is not so natural, as it requires extra indentation for each "else if" clause:

if ...:
    ...
else:
    if ...:
        ...
    else:
        ...

Therefore, add an "elif" keyword with the same meaning as Python:

if ...:
    ...
elif ...:
    ...
else:
    ...

Related branches

Revision history for this message
Matt Giuca (mgiuca) wrote :

Fixed in trunk r1285.

Changed in mars:
status: Triaged → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.