aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-12-04 14:41:28 +0100
committerMartin Odersky <odersky@gmail.com>2016-12-17 18:34:27 +0100
commitee59c23e9033ed775c64583c849bd47cc3f195af (patch)
treee56f199771f26c76b151b8e4c2445440cb97b7fb /docs
parent63ba924a5ad9c01768be22f0b115c9501aa9f23a (diff)
downloaddotty-ee59c23e9033ed775c64583c849bd47cc3f195af.tar.gz
dotty-ee59c23e9033ed775c64583c849bd47cc3f195af.tar.bz2
dotty-ee59c23e9033ed775c64583c849bd47cc3f195af.zip
Generalize syntax for implicit function values
- allow more than one implicit binding - harmonize syntax in expressions and blocks
Diffstat (limited to 'docs')
-rw-r--r--docs/syntax-summary.txt12
1 files changed, 5 insertions, 7 deletions
diff --git a/docs/syntax-summary.txt b/docs/syntax-summary.txt
index fe0ebc89c..d382507d3 100644
--- a/docs/syntax-summary.txt
+++ b/docs/syntax-summary.txt
@@ -125,13 +125,13 @@ grammar.
TypeBounds ::= [`>:' Type] [`<: Type] | INT TypeBoundsTree(lo, hi)
TypeParamBounds ::= TypeBounds {`<%' Type} {`:' Type} ContextBounds(typeBounds, tps)
- Expr ::= FunParams `=>' Expr Function(args, expr), Function(ValDef([implicit], id, TypeTree(), EmptyTree), expr)
+ Expr ::= [`implicit'] FunParams `=>' Expr Function(args, expr), Function(ValDef([implicit], id, TypeTree(), EmptyTree), expr)
FunParams ::= Bindings
- | [`implicit'] id
+ | id
| `_'
ExprInParens ::= PostfixExpr `:' Type
| Expr
- BlockResult ::= (FunParams | [`implicit'] id `:' InfixType) `=>' Block
+ BlockResult ::= [`implicit'] FunParams `=>' Block
| Expr1
Expr1 ::= `if' `(' Expr `)' {nl} Expr [[semi] else Expr] If(Parens(cond), thenp, elsep?)
| `if' Expr `then' Expr [[semi] else Expr] If(cond, thenp, elsep?)
@@ -178,9 +178,7 @@ grammar.
| {Annotation} {LocalModifier} TmplDef
| Expr1
|
- ResultExpr ::= Expr1
- | (Bindings | ([`implicit'] id | `_') `:' ) `=>' Block
- Function(args, block) // block starts at =>
+
ForExpr ::= `for' (`(' Enumerators `)' | `{' Enumerators `}') ForYield(enums, expr)
{nl} [`yield'] Expr ForDo(enums, expr)
| `for' Enumerators (`do' Expr | `yield' Expr)
@@ -241,7 +239,7 @@ grammar.
DefParams ::= DefParam {`,' DefParam}
DefParam ::= {Annotation} [`inline'] Param ValDef(mods, id, tpe, expr) -- point of mods at id.
- Bindings ::= `(' Binding {`,' Binding `)' bindings
+ Bindings ::= `(' Binding {`,' Binding}] `)'
Binding ::= (id | `_') [`:' Type] ValDef(_, id, tpe, EmptyTree)
Modifier ::= LocalModifier