Skip to content
This repository
Browse code

minor grammar refactor

  • Loading branch information...
commit 479ac98d868f162cd03bbf6c9ed78db6bcac90b5 1 parent ad195d3
Gavin King gavinking authored

Showing 1 changed file with 14 additions and 13 deletions. Show diff stats Hide diff stats

  1. +14 13 Ceylon.g
27 Ceylon.g
@@ -1786,13 +1786,23 @@ nonemptyParametersStart
1786 1786 ;
1787 1787
1788 1788 functionOrExpression returns [Expression expression]
1789   - @init { FunctionArgument fa = new FunctionArgument(null);
1790   - fa.setType(new FunctionModifier(null)); }
1791 1789 : (FUNCTION_MODIFIER | anonParametersStart) =>
1792   - (
  1790 + f=anonymousFunction
  1791 + { $expression = $f.expression; }
  1792 + | e=expression
  1793 + { $expression = $e.expression; }
  1794 + ;
  1795 +
  1796 +anonymousFunction returns [Expression expression]
  1797 + @init { FunctionArgument fa = new FunctionArgument(null);
  1798 + fa.setType(new FunctionModifier(null));
  1799 + Expression e = new Expression(null);
  1800 + e.setTerm(fa); }
  1801 + : (
1793 1802 FUNCTION_MODIFIER
1794 1803 { fa.setType(new FunctionModifier($FUNCTION_MODIFIER)); }
1795 1804 )?
  1805 + { $expression=e; }
1796 1806 p1=parameters
1797 1807 { fa.addParameterList($p1.parameterList); }
1798 1808 (
@@ -1802,23 +1812,14 @@ functionOrExpression returns [Expression expression]
1802 1812 )*
1803 1813 COMPUTE?
1804 1814 e1=functionOrExpression
1805   - { fa.setExpression($e1.expression);
1806   - $expression = new Expression(null);
1807   - $expression.setTerm(fa); }
  1815 + { fa.setExpression($e1.expression); }
1808 1816 /*| VALUE_MODIFIER
1809 1817 { fa.setType(new FunctionModifier($VALUE_MODIFIER)); }
1810 1818 e1=expression
1811 1819 { fa.addParameterList(new ParameterList(null));
1812 1820 fa.setExpression($e1.expression);
1813 1821 $positionalArgument = fa; }*/
1814   - | e2=expression
1815   - { $expression = $e2.expression; }
1816 1822 ;
1817   -
1818   -/*inlineFunctionalArgument
1819   - : memberName ((parametersStart) => parameters)?
1820   - (LPAREN expression RPAREN | block)
1821   - ;*/
1822 1823
1823 1824 comprehension returns [Comprehension comprehension]
1824 1825 @init { $comprehension = new Comprehension(null); }

0 comments on commit 479ac98

Please sign in to comment.
Something went wrong with that request. Please try again.