Skip to content

Commit 038dc9c

Browse files
committed
Remove extra whitespace in the spec.
And ensure there is a single EOL at EOF.
1 parent 2a1e3de commit 038dc9c

10 files changed

+20
-20
lines changed

docs/_spec/01-lexical-syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ Inside an interpolated string none of the usual escape characters are interprete
448448
Note that the sequence `\"` does not close a normal string literal (enclosed in single quotes).
449449
450450
There are three forms of dollar sign escape.
451-
The most general form encloses an expression in `${` and `}`, i.e. `${expr}`.
451+
The most general form encloses an expression in `${` and `}`, i.e. `${expr}`.
452452
The expression enclosed in the braces that follow the leading `$` character is of syntactical category BlockExpr.
453453
Hence, it can contain multiple statements, and newlines are significant.
454454
Single ‘$’-signs are not permitted in isolation in an interpolated string.

docs/_spec/03-types.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Non-value types capture properties of identifiers that [are not values](#non-val
4545
For example, a [type constructor](#type-constructors) does not directly specify a type of values.
4646
However, when a type constructor is applied to the correct type arguments, it yields a proper type, which may be a value type.
4747

48-
Non-value types are expressed indirectly in Scala.
48+
Non-value types are expressed indirectly in Scala.
4949
E.g., a method type is described by writing down a method signature, which in itself is not a real type, although it gives rise to a corresponding [method type](#method-types).
5050
Type constructors are another example, as one can write `type Swap[m[_, _], a,b] = m[b, a]`, but there is no syntax to write the corresponding anonymous type function directly.
5151

@@ -130,7 +130,7 @@ SimpleType ::= StableId
130130
```
131131

132132
A _type designator_ refers to a named value type.
133-
It can be simple or qualified.
133+
It can be simple or qualified.
134134
All such type designators are shorthands for type projections.
135135

136136
Specifically, the unqualified type name ´t´ where ´t´ is bound in some class, object, or package ´C´ is taken as a shorthand for
@@ -306,14 +306,14 @@ RefineStat ::= Dcl
306306
|
307307
```
308308

309-
A _compound type_ ´T_1´ `with` ... `with` ´T_n \\{ R \\}´ represents objects with members as given in the component types ´T_1, ..., T_n´ and the refinement ´\\{ R \\}´.
309+
A _compound type_ ´T_1´ `with` ... `with` ´T_n \\{ R \\}´ represents objects with members as given in the component types ´T_1, ..., T_n´ and the refinement ´\\{ R \\}´.
310310
A refinement ´\\{ R \\}´ contains declarations and type definitions.
311311
If a declaration or definition overrides a declaration or definition in one of the component types ´T_1, ..., T_n´, the usual rules for [overriding](05-classes-and-objects.html#overriding) apply; otherwise the declaration or definition is said to be “structural” [^2].
312312

313313
[^2]: A reference to a structurally defined member (method call or access to a value or variable) may generate binary code that is significantly slower than an equivalent code to a non-structural member.
314314

315-
Within a method declaration in a structural refinement, the type of any value parameter may only refer to type parameters or abstract types that are contained inside the refinement.
316-
That is, it must refer either to a type parameter of the method itself, or to a type definition within the refinement.
315+
Within a method declaration in a structural refinement, the type of any value parameter may only refer to type parameters or abstract types that are contained inside the refinement.
316+
That is, it must refer either to a type parameter of the method itself, or to a type definition within the refinement.
317317
This restriction does not apply to the method's result type.
318318

319319
If no refinement is given, the empty refinement is implicitly added, i.e. ´T_1´ `with` ... `with` ´T_n´ is a shorthand for ´T_1´ `with` ... `with` ´T_n \\{\\}´.
@@ -382,7 +382,7 @@ Function types associate to the right, e.g. ´S \Rightarrow T \Rightarrow R´ is
382382
Function types are [covariant](04-basic-declarations-and-definitions.md#variance-annotations) in their result type and [contravariant](04-basic-declarations-and-definitions.md#variance-annotations) in their argument types.
383383

384384
Function types are shorthands for class types that define an `apply` method.
385-
Specifically, the ´n´-ary function type ´(T_1, ..., T_n) \Rightarrow R´ is a shorthand for the class type `Function´_n´[´T_1´, ..., ´T_n´, ´R´]`.
385+
Specifically, the ´n´-ary function type ´(T_1, ..., T_n) \Rightarrow R´ is a shorthand for the class type `Function´_n´[´T_1´, ..., ´T_n´, ´R´]`.
386386
In particular ´() \Rightarrow R´ is a shorthand for class type `Function´_0´[´R´]`.
387387

388388
Such class types behave as if they were instances of the following trait:
@@ -396,7 +396,7 @@ Their exact supertype and implementation can be consulted in the [function class
396396

397397
## Non-Value Types
398398

399-
The types explained in the following do not denote sets of values, nor do they appear explicitly in programs.
399+
The types explained in the following do not denote sets of values, nor do they appear explicitly in programs.
400400
They are introduced in this report as the internal types of defined identifiers.
401401

402402
### Method Types

docs/_spec/04-basic-declarations-and-definitions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ final val x = e
7979
```
8080

8181
where `e` is a [constant expression](06-expressions.html#constant-expressions).
82-
The `final` modifier must be present and no type annotation may be given.
82+
The `final` modifier must be present and no type annotation may be given.
8383
References to the constant value `x` are themselves treated as constant expressions; in the generated code they are replaced by the definition's right-hand side `e`.
8484

8585
Value definitions can alternatively have a [pattern](08-pattern-matching.html#patterns) as left-hand side.
@@ -311,7 +311,7 @@ TypeParam ::= (id | ‘_’) [TypeParamClause] [‘>:’ Type] [‘<:’
311311
Type parameters appear in type definitions, class definitions, and method definitions.
312312
In this section we consider only type parameter definitions with lower bounds `>: ´L´` and upper bounds `<: ´U´` whereas a discussion of context bounds `: ´U´` and view bounds `<% ´U´` is deferred to [here](07-implicits.html#context-bounds-and-view-bounds).
313313

314-
The most general form of a proper type parameter is
314+
The most general form of a proper type parameter is
315315
`´@a_1 ... @a_n´ ´\pm´ ´t´ >: ´L´ <: ´U´`.
316316
Here, ´L´, and ´U´ are lower and upper bounds that constrain possible type arguments for the parameter.
317317
It is a compile-time error if ´L´ does not conform to ´U´.

docs/_spec/05-classes-and-objects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ These are defined by constructor definitions of the form `def this(´\mathit{ps}
538538
Such a definition introduces an additional constructor for the enclosing class, with parameters as given in the formal parameter lists ´\mathit{ps}_1 , ..., \mathit{ps}_n´, and whose evaluation is defined by the constructor expression ´e´.
539539
The scope of each formal parameter is the subsequent parameter sections and the constructor expression ´e´.
540540
A constructor expression is either a self constructor invocation `this(´\mathit{args}_1´)...(´\mathit{args}_n´)` or a block which begins with a self constructor invocation.
541-
The self constructor invocation must construct a generic instance of the class.
541+
The self constructor invocation must construct a generic instance of the class.
542542
I.e. if the class in question has name ´C´ and type parameters `[´\mathit{tps}\,´]`, then a self constructor invocation must generate an instance of `´C´[´\mathit{tps}\,´]`; it is not permitted to instantiate formal type parameters.
543543

544544
The signature and the self constructor invocation of a constructor definition are type-checked and evaluated in the scope which is in effect at the point of the enclosing class definition, augmented by any type parameters of the enclosing class.

docs/_spec/06-expressions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ Generator ::= [‘case’] Pattern1 ‘<-’ Expr {[semi] Guard | semi Pat
713713
Guard ::= ‘if’ PostfixExpr
714714
```
715715

716-
A _for loop_ `for (´\mathit{enums}\,´) ´e´` executes expression ´e´ for each binding generated by the enumerators ´\mathit{enums}´.
716+
A _for loop_ `for (´\mathit{enums}\,´) ´e´` executes expression ´e´ for each binding generated by the enumerators ´\mathit{enums}´.
717717
A _for comprehension_ `for (´\mathit{enums}\,´) yield ´e´` evaluates expression ´e´ for each binding generated by the enumerators ´\mathit{enums}´ and collects the results.
718718
An enumerator sequence always starts with a generator; this can be followed by further generators, value definitions, or guards.
719719

docs/_spec/08-pattern-matching.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ Taking XML as an example
113113
implicit class XMLinterpolation(s: StringContext) = {
114114
object xml {
115115
def apply(exprs: Any*) =
116-
// parse ‘s’ and build an XML tree with ‘exprs’
116+
// parse ‘s’ and build an XML tree with ‘exprs’
117117
//in the holes
118118
def unapplySeq(xml: Node): Option[Seq[Node]] =
119-
// match `s’ against `xml’ tree and produce
119+
// match `s’ against `xml’ tree and produce
120120
//subtrees in holes
121121
}
122122
}
@@ -500,7 +500,7 @@ Each case consists of a (possibly guarded) pattern ´p_i´ and a block ´b_i´.
500500
Each ´p_i´ might be complemented by a guard `if ´e´` where ´e´ is a boolean expression.
501501
The scope of the pattern variables in ´p_i´ comprises the pattern's guard and the corresponding block ´b_i´.
502502

503-
Let ´T´ be the type of the selector expression ´e´ and let ´a_1, ..., a_m´ be the type parameters of all methods enclosing the pattern matching expression.
503+
Let ´T´ be the type of the selector expression ´e´ and let ´a_1, ..., a_m´ be the type parameters of all methods enclosing the pattern matching expression.
504504
For every ´a_i´, let ´L_i´ be its lower bound and ´U_i´ be its higher bound.
505505
Every pattern ´p \in \{p_1,, ..., p_n\}´ can be typed in two ways.
506506
First, it is attempted to type ´p´ with ´T´ as its expected type.
@@ -566,7 +566,7 @@ def eval[T](t: Term[T]): T = t match {
566566

567567
Note that the evaluator makes crucial use of the fact that type parameters of enclosing methods can acquire new bounds through pattern matching.
568568

569-
For instance, the type of the pattern in the second case, `Succ(u)`, is `Int`.
569+
For instance, the type of the pattern in the second case, `Succ(u)`, is `Int`.
570570
It conforms to the selector type `T` only if we assume an upper and lower bound of `Int` for `T`.
571571
Under the assumption `Int <: T <: Int` we can also verify that the type right hand side of the second case, `Int` conforms to its expected type, `T`.
572572

docs/_spec/11-annotations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ trait Function0[@specialized(Unit, Int, Double) T] {
109109
```
110110
Whenever the static type of an expression matches a specialized variant of a definition, the compiler will instead use the specialized version.
111111
See the [specialization sid](https://docs.scala-lang.org/sips/scala-specialization.html) for more details of the implementation.
112-
112+
113113

114114
## User-defined Annotations
115115

docs/_spec/A1-deprecated.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ scalac Test.scala
1818
| For now, you can also `import language.deprecated.symbolLiterals` to accept
1919
| the idiom, but this possibility might no longer be available in the future.
2020
1 error found
21-
```
21+
```

docs/_spec/A2-scala-2-compatibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ def f(): Unit = { ... }
3232
Scala 3 accepts the old syntax under the `-source:3.0-migration` option.
3333
If the `-migration` option is set, it can even rewrite old syntax to new.
3434
The [Scalafix](https://scalacenter.github.io/scalafix/) tool also
35-
can rewrite procedure syntax to make it Scala 3 compatible.
35+
can rewrite procedure syntax to make it Scala 3 compatible.

docs/_spec/A3-to-be-deprecated.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
This is a simple list of feature that are not deprecated yet, but will be in the future.
22
They should emit warnings or errors only when using the `-source:future` compiler flag.
33

4-
- [private[this] and protected[this]](../_docs/reference/dropped-features/this-qualifier.md)
4+
- [private[this] and protected[this]](../_docs/reference/dropped-features/this-qualifier.md)

0 commit comments

Comments
 (0)