@@ -43,17 +43,17 @@ colon ::= ':' -- with side conditions explained above
43
43
## Identifiers
44
44
45
45
``` ebnf
46
- op ::= opchar {opchar}
47
- varid ::= lower idrest
48
- boundvarid ::= varid
49
- | ‘`’ varid ‘`’
50
- alphaid ::= upper idrest
51
- | varid
52
- plainid ::= alphaid
53
- | op
54
- id ::= plainid
55
- | ‘`’ { charNoBackQuoteOrNewline | escapeSeq } ‘`’
56
- idrest ::= {letter | digit} [‘_’ op]
46
+ op ::= opchar {opchar}
47
+ varid ::= lower idrest
48
+ boundvarid ::= varid
49
+ | ‘`’ varid ‘`’
50
+ alphaid ::= upper idrest
51
+ | varid
52
+ plainid ::= alphaid
53
+ | op
54
+ id ::= plainid
55
+ | ‘`’ { charNoBackQuoteOrNewline | escapeSeq } ‘`’
56
+ idrest ::= {letter | digit} [‘_’ op]
57
57
escapeSeq ::= UnicodeEscape | charEscapeSeq
58
58
UnicodeEscape ::= ‘\’ ‘u’ {‘u’} hexDigit hexDigit hexDigit hexDigit
59
59
hexDigit ::= ‘0’ | ... | ‘9’ | ‘A’ | ... | ‘F’ | ‘a’ | ... | ‘f’
@@ -83,7 +83,7 @@ For this purpose, lower case letters include not only a-z, but also all characte
83
83
84
84
The following are examples of variable identifiers:
85
85
86
- > ``` scala
86
+ > ```
87
87
> x maxIndex p2p empty_?
88
88
> `yield` αρετη _y dot_product_*
89
89
> __system _MAX_LEN_
@@ -92,7 +92,7 @@ The following are examples of variable identifiers:
92
92
93
93
Some examples of constant identifiers are
94
94
95
- > ```scala
95
+ > ```
96
96
> + Object $reserved Džul ǂnûm
97
97
> ⅰ_ⅲ Ⅰ_Ⅲ ↁelerious ǃqhàà ʹthatsaletter
98
98
> ```
@@ -104,7 +104,7 @@ User programs should not define identifiers that contain ‘$’ characters.
104
104
105
105
The following names are reserved words instead of being members of the syntactic class `id` of lexical identifiers.
106
106
107
- ```scala
107
+ ```
108
108
abstract case catch class def do else
109
109
enum export extends false final finally for
110
110
given if implicit import lazy match new
@@ -169,17 +169,16 @@ A newline in a Scala source text is treated as the special token “nl” if the
169
169
170
170
The tokens that can terminate a statement are: literals, identifiers and the following delimiters and reserved words:
171
171
172
- ``` scala
172
+ ```
173
173
this null true false return type <xml-start>
174
174
_ ) ] }
175
175
```
176
176
177
177
The tokens that can begin a statement are all Scala tokens _ except_ the following delimiters and reserved words:
178
178
179
- ``` scala
180
- catch else extends finally forSome match
181
- with yield , . ; : = => <- <: <%
182
- >: # [ ) ] }
179
+ ```
180
+ catch else extends finally forSome match with yield
181
+ , . ; : = => <- <: <% >: # [ ) ] }
183
182
```
184
183
185
184
A ` case ` token can begin a statement only if followed by a
@@ -334,8 +333,7 @@ Literal ::= [‘-’] integerLiteral
334
333
### Integer Literals
335
334
336
335
``` ebnf
337
- integerLiteral ::= (decimalNumeral | hexNumeral)
338
- [‘L’ | ‘l’]
336
+ integerLiteral ::= (decimalNumeral | hexNumeral) [‘L’ | ‘l’]
339
337
decimalNumeral ::= ‘0’ | digit [{digit | ‘_’} digit]
340
338
hexNumeral ::= ‘0’ (‘x’ | ‘X’) hexDigit [{hexDigit | ‘_’} hexDigit]
341
339
```
@@ -366,11 +364,10 @@ The digits of a numeric literal may be separated by arbitrarily many underscores
366
364
### Floating Point Literals
367
365
368
366
```ebnf
369
- floatingPointLiteral
370
- ::= [decimalNumeral] ‘.’ digit [{digit | ‘_’} digit] [exponentPart] [floatType]
371
- | decimalNumeral exponentPart [floatType]
372
- | decimalNumeral floatType
373
- exponentPart ::= (‘E ’ | ‘e’) [‘+ ’ | ‘- ’] digit [{digit | ‘_’} digit]
367
+ floatingPointLiteral ::= [decimalNumeral] ‘.’ digit [{digit | ‘_’} digit] [exponentPart] [floatType]
368
+ | decimalNumeral exponentPart [floatType]
369
+ | decimalNumeral floatType
370
+ exponentPart ::= (‘E ’ | ‘e’) [‘+ ’ | ‘- ’] digit [{digit | ‘_’} digit]
374
371
```
375
372
376
373
Floating point literals are of type ` Float ` when followed by a floating point type suffix ` F ` or ` f ` , and are of type ` Double ` otherwise.
@@ -452,7 +449,7 @@ Characters must not necessarily be printable; newlines or other control characte
452
449
>
453
450
> This would produce the string:
454
451
>
455
- > ```scala
452
+ > ```
456
453
> the present string
457
454
> spans three
458
455
> lines.
@@ -469,7 +466,7 @@ Characters must not necessarily be printable; newlines or other control characte
469
466
>
470
467
> evaluates to
471
468
>
472
- > ```scala
469
+ > ```
473
470
> the present string
474
471
> spans three
475
472
> lines.
0 commit comments