Skip to content

Commit d5ac8e5

Browse files
authored
Adjust headers levels (#15933)
- Increase all header levels in files without h2 headers - Fix docs starting with h3 headers - Few other minor header fixes
2 parents a42fe2a + 8f18d67 commit d5ac8e5

34 files changed

+105
-105
lines changed

docs/_docs/internals/backend.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ BCodeIdiomatic ----------------> utilities for code generation, e.g.
3030

3131
The `BTypes.scala` class contains the `BType` class and predefined BTypes
3232

33-
### Data Flow ###
33+
## Data Flow ##
3434
Compiler creates a `GenBCode` `Phase`, calls `runOn(compilationUnits)`,
3535
which calls `run(context)`. This:
3636

@@ -51,12 +51,12 @@ which calls `run(context)`. This:
5151
- `GenBCodePipeline.drainQ3` writes byte arrays to disk
5252

5353

54-
### Architecture ###
54+
## Architecture ##
5555
The architecture of `GenBCode` is the same as in Scalac. It can be partitioned
5656
into weakly coupled components (called "subsystems" below):
5757

5858

59-
#### (a) The queue subsystem ####
59+
### (a) The queue subsystem ###
6060
Queues mediate between processors, queues don't know what each processor does.
6161

6262
The first queue contains AST trees for compilation units, the second queue
@@ -70,7 +70,7 @@ serialization to disk.
7070

7171
This subsystem is described in detail in `GenBCode.scala`
7272

73-
#### (b) Bytecode-level types, BType ####
73+
### (b) Bytecode-level types, BType ###
7474
The previous bytecode emitter goes to great lengths to reason about
7575
bytecode-level types in terms of Symbols.
7676

@@ -89,7 +89,7 @@ spec (that's why they aren't documented in `GenBCode`, just read the [JVM 8 spec
8989

9090
All things `BType` can be found in `BCodeGlue.scala`
9191

92-
#### (c) Utilities offering a more "high-level" API to bytecode emission ####
92+
### (c) Utilities offering a more "high-level" API to bytecode emission ###
9393
Bytecode can be emitted one opcode at a time, but there are recurring patterns
9494
that call for a simpler API.
9595

@@ -100,7 +100,7 @@ of two strategies.
100100
All these utilities are encapsulated in file `BCodeIdiomatic.scala`. They know
101101
nothing about the type checker (because, just between us, they don't need to).
102102

103-
#### (d) Mapping between type-checker types and BTypes ####
103+
### (d) Mapping between type-checker types and BTypes ###
104104
So that (c) can remain oblivious to what AST trees contain, some bookkeepers
105105
are needed:
106106

@@ -115,7 +115,7 @@ final def exemplar(csym0: Symbol): Tracked = { ... }
115115

116116
Details in `BTypes.scala`
117117

118-
#### (e) More "high-level" utilities for bytecode emission ####
118+
### (e) More "high-level" utilities for bytecode emission ###
119119
In the spirit of `BCodeIdiomatic`, utilities are added in `BCodeHelpers` for
120120
emitting:
121121

@@ -125,5 +125,5 @@ emitting:
125125
- annotations
126126

127127

128-
#### (f) Building an ASM ClassNode given an AST TypeDef ####
128+
### (f) Building an ASM ClassNode given an AST TypeDef ###
129129
It's done by `PlainClassBuilder`(see `GenBCode.scala`).

docs/_docs/internals/contexts.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The `Context` contains the state of the compiler, for example
1616
* `typerState` (for example undetermined type variables)
1717
* ...
1818

19-
### Contexts in the typer ###
19+
## Contexts in the typer ##
2020
The type checker passes contexts through all methods and adapts fields where
2121
necessary, e.g.
2222

@@ -26,7 +26,7 @@ case tree: untpd.Block => typedBlock(desugar.block(tree), pt)(ctx.fresh.withNewS
2626

2727
A number of fields in the context are typer-specific (`mode`, `typerState`).
2828

29-
### In other phases ###
29+
## In other phases ##
3030
Other phases need a context for many things, for example to access the
3131
denotation of a symbols (depends on the period). However they typically don't
3232
need to modify / extend the context while traversing the AST. For these phases
@@ -36,7 +36,7 @@ all members.
3636
**Careful**: beware of memory leaks. Don't hold on to contexts in long lived
3737
objects.
3838

39-
### Using contexts ###
39+
## Using contexts ##
4040
Nested contexts should be named `ctx` to enable implicit shadowing:
4141

4242
```scala

docs/_docs/internals/dotc-scalac.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: "Differences between Scalac and Dotty"
66
Overview explanation how symbols, named types and denotations hang together:
77
[Denotations1]
88

9-
### Denotation ###
9+
## Denotation ##
1010
Comment with a few details: [Denotations2]
1111

1212
A `Denotation` is the result of a name lookup during a given period
@@ -21,7 +21,7 @@ A `Denotation` is the result of a name lookup during a given period
2121
Denotations of methods have a signature ([Signature1]), which
2222
uniquely identifies overloaded methods.
2323

24-
#### Denotation vs. SymDenotation ####
24+
### Denotation vs. SymDenotation ###
2525
A `SymDenotation` is an extended denotation that has symbol-specific properties
2626
(that may change over phases)
2727
* `flags`
@@ -31,7 +31,7 @@ A `SymDenotation` is an extended denotation that has symbol-specific properties
3131
`SymDenotation` implements lazy types (similar to scalac). The type completer
3232
assigns the denotation's `info`.
3333

34-
#### Implicit Conversion ####
34+
### Implicit Conversion ###
3535
There is an implicit conversion:
3636
```scala
3737
core.Symbols.toDenot(sym: Symbol)(implicit ctx: Context): SymDenotation
@@ -42,7 +42,7 @@ implicit conversion does **not** need to be imported, it is part of the
4242
implicit scope of the type `Symbol` (check the Scala spec). However, it can
4343
only be applied if an implicit `Context` is in scope.
4444

45-
### Symbol ###
45+
## Symbol ##
4646
* `Symbol` instances have a `SymDenotation`
4747
* Most symbol properties in the Scala 2 compiler are now in the denotation (in the Scala 3 compiler).
4848

@@ -57,7 +57,7 @@ if (sym is Flags.PackageClass) // Scala 3 (*)
5757
`(*)` Symbols are implicitly converted to their denotation, see above. Each
5858
`SymDenotation` has flags that can be queried using the `is` method.
5959

60-
### Flags ###
60+
## Flags ##
6161
* Flags are instances of the value class `FlagSet`, which encapsulates a
6262
`Long`
6363
* Each flag is either valid for types, terms, or both
@@ -74,7 +74,7 @@ if (sym is Flags.PackageClass) // Scala 3 (*)
7474
`ModuleVal` / `ModuleClass` for either of the two.
7575
* `flags.is(Method | Param)`: true if `flags` has either of the two
7676

77-
### Tree ###
77+
## Tree ##
7878
* Trees don't have symbols
7979
- `tree.symbol` is `tree.denot.symbol`
8080
- `tree.denot` is `tree.tpe.denot` where the `tpe` is a `NamdedType` (see
@@ -87,7 +87,7 @@ if (sym is Flags.PackageClass) // Scala 3 (*)
8787
using `prefix.member(name)`.
8888

8989

90-
### Type ###
90+
## Type ##
9191
* `MethodType(paramSyms, resultType)` from scalac =>
9292
`mt @ MethodType(paramNames, paramTypes)`. Result type is `mt.resultType`
9393

docs/_docs/internals/syntax-3.1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ hexDigit ::= ‘0’ | … | ‘9’ | ‘A’ | … | ‘F’ | ‘a’ |
1616

1717
Informal descriptions are typeset as `“some comment”`.
1818

19-
### Lexical Syntax
19+
## Lexical Syntax
2020
The lexical syntax of Scala is given by the following grammar in EBNF
2121
form.
2222

docs/_docs/internals/syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ hexDigit ::= ‘0’ | … | ‘9’ | ‘A’ | … | ‘F’ | ‘a’ |
3030

3131
Informal descriptions are typeset as `“some comment”`.
3232

33-
### Lexical Syntax
33+
## Lexical Syntax
3434

3535
The lexical syntax of Scala is given by the following grammar in EBNF
3636
form.

docs/_docs/reference/changed-features/imports.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ import scala.annotation as ann
3838
import java as j
3939
```
4040

41-
### Migration
41+
## Migration
4242

4343
To support cross-building, Scala 3.0 supports the old import syntax with `_` for wildcards and `=>` for renamings in addition to the new one. The old syntax
4444
will be dropped in a future versions. Automatic rewritings from old to new syntax
4545
are offered under settings `-source 3.1-migration -rewrite`.
4646

47-
### Syntax
47+
## Syntax
4848

4949
```
5050
Import ::= ‘import’ ImportExpr {‘,’ ImportExpr}

docs/_docs/reference/changed-features/wildcards.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ List[?]
1010
Map[? <: AnyRef, ? >: Null]
1111
```
1212

13-
### Motivation
13+
## Motivation
1414

1515
We would like to use the underscore syntax `_` to stand for an anonymous type parameter, aligning it with its meaning in
1616
value parameter lists. So, just as `f(_)` is a shorthand for the lambda `x => f(x)`, in the future `C[_]` will be a shorthand
@@ -21,7 +21,7 @@ In the future, `F[_]` will mean the same thing, no matter where it is used.
2121
We pick `?` as a replacement syntax for wildcard types, since it aligns with
2222
[Java's syntax](https://docs.oracle.com/javase/tutorial/java/generics/wildcardGuidelines.html).
2323

24-
### Migration Strategy
24+
## Migration Strategy
2525

2626
The migration to the new scheme is complicated, in particular since the [kind projector](https://github.com/typelevel/kind-projector)
2727
compiler plugin still uses the reverse convention, with `?` meaning parameter placeholder instead of wildcard. Fortunately, kind projector has added `*` as an alternative syntax for `?`.

docs/_docs/reference/contextual/by-name-context-parameters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ val s = summon[Test.Codec[Option[Int]]](
5959

6060
No local given instance was generated because the synthesized argument is not recursive.
6161

62-
### Reference
62+
## Reference
6363

6464
For more information, see [Issue #1998](https://github.com/lampepfl/dotty/issues/1998)
6565
and the associated [Scala SIP](https://docs.scala-lang.org/sips/byname-implicits.html).

docs/_docs/reference/contextual/context-functions-spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ See the section on Expressiveness from [Simplicitly: foundations and
7474
applications of implicit function
7575
types](https://dl.acm.org/citation.cfm?id=3158130).
7676

77-
### Type Checking
77+
## Type Checking
7878

7979
After desugaring no additional typing rules are required for context function types.

docs/_docs/reference/contextual/context-functions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ For example, continuing with the previous definitions,
4848
g((ctx: ExecutionContext) ?=> f(3)(using ctx)) // is left as it is
4949
```
5050

51-
### Example: Builder Pattern
51+
## Example: Builder Pattern
5252

5353
Context function types have considerable expressive power. For
5454
instance, here is how they can support the "builder pattern", where
@@ -112,7 +112,7 @@ With that setup, the table construction code above compiles and expands to:
112112
}(using $t)
113113
}
114114
```
115-
### Example: Postconditions
115+
## Example: Postconditions
116116

117117
As a larger example, here is a way to define constructs for checking arbitrary postconditions using an extension method `ensuring` so that the checked result can be referred to simply by `result`. The example combines opaque type aliases, context function types, and extension methods to provide a zero-overhead abstraction.
118118

@@ -146,7 +146,7 @@ val s =
146146
assert(result == 6)
147147
result
148148
```
149-
### Reference
149+
## Reference
150150

151151
For more information, see the [blog article](https://www.scala-lang.org/blog/2016/12/07/implicit-function-types.html),
152152
(which uses a different syntax that has been superseded).

0 commit comments

Comments
 (0)