diff options
author | Jonathan Brachthäuser <jonathan@b-studios.de> | 2016-12-21 21:41:03 +0100 |
---|---|---|
committer | Jonathan Brachthäuser <jonathan@b-studios.de> | 2016-12-21 21:42:18 +0100 |
commit | cdc44429a2791b5a3c70cca38aa3aaa6d4e0d889 (patch) | |
tree | 146398061a2dca8e3b987362ef62bbe28b514f69 /docs/docs/internals/syntax.md | |
parent | bac774d6d67f0916b0a394bd6414bf27026890de (diff) | |
download | dotty-cdc44429a2791b5a3c70cca38aa3aaa6d4e0d889.tar.gz dotty-cdc44429a2791b5a3c70cca38aa3aaa6d4e0d889.tar.bz2 dotty-cdc44429a2791b5a3c70cca38aa3aaa6d4e0d889.zip |
Fill in definitions from 2.12
Diffstat (limited to 'docs/docs/internals/syntax.md')
-rw-r--r-- | docs/docs/internals/syntax.md | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/docs/docs/internals/syntax.md b/docs/docs/internals/syntax.md index 7e249d6a0..34acae2f4 100644 --- a/docs/docs/internals/syntax.md +++ b/docs/docs/internals/syntax.md @@ -21,13 +21,18 @@ The lexical syntax of Scala is given by the following grammar in EBNF form. ```ebnf +whiteSpace ::= ‘\u0020’ | ‘\u0009’ | ‘\u000D’ | ‘\u000A’ upper ::= ‘A’ | … | ‘Z’ | ‘\$’ | ‘_’ “… and Unicode category Lu” lower ::= ‘a’ | … | ‘z’ “… and Unicode category Ll” letter ::= upper | lower “… and Unicode categories Lo, Lt, Nl” digit ::= ‘0’ | … | ‘9’ +paren ::= ‘(’ | ‘)’ | ‘[’ | ‘]’ | ‘{’ | ‘}’ +delim ::= ‘`’ | ‘'’ | ‘"’ | ‘.’ | ‘;’ | ‘,’ opchar ::= “printableChar not matched by (whiteSpace | upper | lower | letter | digit | paren | delim | opchar | Unicode_Sm | Unicode_So)” +printableChar ::= “all characters in [\u0020, \u007F] inclusive” +charEscapeSeq ::= ‘\’ (‘b’ | ‘t’ | ‘n’ | ‘f’ | ‘r’ | ‘"’ | ‘'’ | ‘\’) op ::= opchar {opchar} varid ::= lower idrest @@ -36,7 +41,7 @@ alphaid ::= upper idrest plainid ::= alphaid | op id ::= plainid - | ‘\`’ stringLit ‘\`’ + | ‘`’ { charNoBackQuoteOrNewline | UnicodeEscape | charEscapeSeq } ‘`’ | INT // interpolation id, only for quasi-quotes idrest ::= {letter | digit} [‘_’ op] @@ -51,20 +56,19 @@ floatingPointLiteral | ‘.’ digit {digit} [exponentPart] [floatType] | digit {digit} exponentPart [floatType] | digit {digit} [exponentPart] floatType - exponentPart ::= (‘E’ | ‘e’) [‘+’ | ‘-’] digit {digit} floatType ::= ‘F’ | ‘f’ | ‘D’ | ‘d’ + booleanLiteral ::= ‘true’ | ‘false’ -characterLiteral ::= ‘\'’ printableChar ‘\'’ - | ‘\'’ charEscapeSeq ‘\'’ +characterLiteral ::= ‘'’ (printableChar | charEscapeSeq) ‘'’ stringLiteral ::= ‘"’ {stringElement} ‘"’ - | ‘"""’ {[‘"’] [‘"’] char \ ‘"’} {‘"’} ‘"""’ + | ‘"""’ multiLineChars ‘"""’ stringElement ::= printableChar \ (‘"’ | ‘\’) + | UnicodeEscape | charEscapeSeq -charEscapeSeq ::= ‘\b’ | ‘\n’ | ‘\t’ | ‘\f’ | ‘\r’ | ‘"’ | ‘'’ | ‘\\’ - +multiLineChars ::= {[‘"’] [‘"’] char \ ‘"’} {‘"’} processedStringLiteral ::= alphaid ‘"’ {printableChar \ (‘"’ | ‘$’) | escape} ‘"’ | alphaid ‘"""’ {[‘"’] [‘"’] char \ (‘"’ | ‘$’) | escape} {‘"’} ‘"""’ @@ -72,7 +76,6 @@ escape ::= ‘$$’ \comment{$} | ‘$’ letter { letter | digit } | ‘{’ Block [‘;’ whiteSpace stringFormat whiteSpace] ‘}’ stringFormat ::= {printableChar \ (‘"’ | ‘}’ | ‘ ’ | ‘\t’ | ‘\n’)} -whiteSpace ::= {‘ ’ | ‘\t’} symbolLiteral ::= ‘'’ plainid |