Commits

John McCall committed dd48c25d3fa
Parse 'try' expressions. We parse 'try' as if it were a unary operator allowed on an arbitrary element of an expr-sequence, but sequence-folding constrains it to never appear on the RHS of most operators. We do allow it on the RHS of an assignment or conditional operator, but not if there's anything to the right which was not parsed within the RHS. We do this for assignments so that var x = try whatever and x = try whatever both work as you might expect. We do this for conditionals because it feels natural to allow 'try' in the center operand, and then disallowing it in the right operand feels very strange. In both case, this works largely because these operators are assumed to be very low-precedence; there are no standard operators which would parse outside the RHS. But if you create one and use 'try' before it, we'll diagnose it. Swift SVN r26052