Skip to content

Commit

Permalink
change precedence of let body to accept much more code #747
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinking committed Nov 27, 2014
1 parent 8a6fa8c commit 75806fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
6 changes: 2 additions & 4 deletions Ceylon.g
Original file line number Diff line number Diff line change
Expand Up @@ -2011,10 +2011,8 @@ letClause returns [LetClause letClause]
)?
RPAREN
{ $letClause.setEndToken($RPAREN); }
disjunctionExpression
{ Expression e = new Expression(null);
e.setTerm($disjunctionExpression.term);
$letClause.setExpression(e);
functionOrExpression
{ $letClause.setExpression($functionOrExpression.expression);
$letClause.setEndToken(null); }
;
Expand Down
14 changes: 5 additions & 9 deletions en/modules/expressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1503,16 +1503,11 @@ Digit{1,2} ":" Digit{2} ( ":" Digit{2} ( ":" Digit{3} )? )?
<title>Let expressions</title>

<para>A let expression comprises a list of one or more variable
declarations, followed by an expression involving those variables.</para>
declarations, as defined in <xref linkend="controlstructurevariables"/>,
followed by an expression involving those variables.</para>

<synopsis>LetExpression: "let" LetValueList Expression</synopsis>

<para>The expression is parsed with precedence just higher than the
<literal>||</literal> operator, and just lower than the
<literal>then</literal> and <literal>else</literal> operators, that
is, between the layers 3 and 4 defined in
<xref linkend="operatorprecedence"/>.</para>

<synopsis>LetValueList: "(" LetValue ("," LetValue)* ")"</synopsis>

<para>Each variable is a shortcut reference declaration, as defined
Expand Down Expand Up @@ -1554,7 +1549,8 @@ Digit{1,2} ":" Digit{2} ( ":" Digit{2} ( ":" Digit{3} )? )?

<para>The type of an inline anonymous class expression is the
intersection of the class type it extends with all interface types
it satisfies.</para>
it satisfies. The type of the inline anonymous class itself is not
accessible outside the body of the inline anonymous class expression.</para>

<programlisting>object
satisfies {Integer+} {
Expand All @@ -1564,7 +1560,7 @@ Digit{1,2} ":" Digit{2} ( ":" Digit{2} ( ":" Digit{3} )? )?
next() => current++;
};
}</programlisting>

</section>

</section>
Expand Down

0 comments on commit 75806fb

Please sign in to comment.