diff options
author | Jonathan Brachthäuser <jonathan@b-studios.de> | 2016-12-21 20:14:13 +0100 |
---|---|---|
committer | Jonathan Brachthäuser <jonathan@b-studios.de> | 2016-12-21 21:29:19 +0100 |
commit | 08400a03406e240a1545170625502f32d56bf0f5 (patch) | |
tree | bbaa054618dc4efd32b9aec0f5814608906d2d0a /docs | |
parent | e0a1f7ebbcf83dae4aea65218da656759c794d62 (diff) | |
download | dotty-08400a03406e240a1545170625502f32d56bf0f5.tar.gz dotty-08400a03406e240a1545170625502f32d56bf0f5.tar.bz2 dotty-08400a03406e240a1545170625502f32d56bf0f5.zip |
Split into sections
Diffstat (limited to 'docs')
-rw-r--r-- | docs/docs/internals/syntax.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/docs/internals/syntax.md b/docs/docs/internals/syntax.md index 0d1ed0f9f..82ecdddbb 100644 --- a/docs/docs/internals/syntax.md +++ b/docs/docs/internals/syntax.md @@ -87,6 +87,7 @@ semi ::= ‘;’ | nl {nl} The context-free syntax of Scala is given by the following EBNF grammar: +### Literals and Paths ```ebnf SimpleLiteral ::= [‘-’] integerLiteral | [‘-’] floatingPointLiteral @@ -107,7 +108,10 @@ StableId ::= id | Path ‘.’ id | [id ‘.’] ‘super’ [ClassQualifier] ‘.’ id ClassQualifier ::= ‘[’ id ‘]’ +``` +### Types +```ebnf Type ::= [‘implicit’] FunArgTypes ‘=>’ Type | HkTypeParamClause ‘=>’ Type | InfixType @@ -224,7 +228,10 @@ PatVar ::= varid Patterns ::= Pattern {‘,’ Pattern} ArgumentPatterns ::= ‘(’ [Patterns] ‘)’ | ‘(’ [Patterns ‘,’] Pattern2 ‘:’ ‘_’ ‘*’ ') +``` +### Type and Value Parameters +```ebnf ClsTypeParamClause::= ‘[’ ClsTypeParam {‘,’ ClsTypeParam} ‘]’ ClsTypeParam ::= {Annotation} [{Modifier} type] [‘+’ | ‘-’] id [HkTypeParamClause] TypeParamBounds @@ -251,7 +258,10 @@ DefParamClauses ::= {DefParamClause} [[nl] ‘(’ ‘implicit’ DefParams â DefParamClause ::= [nl] ‘(’ [DefParams] ‘)’ DefParams ::= DefParam {‘,’ DefParam} DefParam ::= {Annotation} [‘inline’] Param +``` +### Bindings and Imports +```ebnf Bindings ::= ‘(’ Binding {‘,’ Binding}] ‘)’ Binding ::= (id | ‘_’) [‘:’ Type] @@ -281,7 +291,10 @@ Import ::= ‘import’ ImportExpr {‘,’ ImportExpr} ImportExpr ::= StableId ‘.’ (id | ‘_’ | ImportSelectors) ImportSelectors ::= ‘{’ {ImportSelector ‘,’} (ImportSelector | ‘_’) ‘}’ ImportSelector ::= id [‘=>’ id | ‘=>’ ‘_’] +``` +### Declarations and Definitions +```ebnf Dcl ::= ‘val’ ValDcl | ‘var’ VarDcl | ‘def’ DefDcl |