Skip to content

Commit

Permalink
github markdown: headers
Browse files Browse the repository at this point in the history
  • Loading branch information
adriaanm committed Mar 10, 2014
1 parent 839fd6e commit df2f3f7
Show file tree
Hide file tree
Showing 16 changed files with 95 additions and 190 deletions.
3 changes: 1 addition & 2 deletions 02-preface.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Preface
-------
## Preface

Scala is a Java-like programming language which unifies
object-oriented and functional programming. It is a pure
Expand Down
18 changes: 6 additions & 12 deletions 03-lexical-syntax.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Lexical Syntax
==============
# Lexical Syntax

Scala programs are written using the Unicode Basic Multilingual Plane
(_BMP_) character set; Unicode supplementary characters are not
Expand Down Expand Up @@ -34,8 +33,7 @@ classes (Unicode general category given in parentheses):

\pagebreak[1]

Identifiers
-----------
## Identifiers

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
op ::= opchar {opchar}
Expand Down Expand Up @@ -108,8 +106,7 @@ equivalents ‘=>’ and ‘<-’, are also reserved.
work-around: `` Thread.`yield`() ``{.scala}


Newline Characters
------------------
## Newline Characters

~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
semi ::= ‘;’ | nl {nl}
Expand Down Expand Up @@ -293,8 +290,7 @@ A single new line token is accepted
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Literals
----------
## Literals

There are literals for integer numbers, floating point numbers,
characters, booleans, symbols, strings. The syntax of these literals is in
Expand Down Expand Up @@ -549,8 +545,7 @@ identical symbol literals are equivalent with respect to reference
equality.


Whitespace and Comments
-----------------------
## Whitespace and Comments

Tokens may be separated by whitespace characters
and/or comments. Comments come in two forms:
Expand All @@ -565,8 +560,7 @@ but are required to be properly nested. Therefore, a comment like
comment.


XML mode
--------
## XML mode

In order to allow literal inclusion of XML fragments, lexical analysis
switches from Scala mode to XML mode when encountering an opening
Expand Down
3 changes: 1 addition & 2 deletions 04-identifiers-names-and-scopes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Identifiers, Names and Scopes
=============================
# Identifiers, Names and Scopes

Names in Scala identify types, values, methods, and classes which are
collectively called _entities_. Names are introduced by local
Expand Down
24 changes: 8 additions & 16 deletions 05-types.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Types
=====
# Types

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
Type ::= FunctionArgTypes ‘=>’ Type
Expand Down Expand Up @@ -59,8 +58,7 @@ Type constructors are another example, as one can write
the corresponding anonymous type function directly.


Paths
-----
## Paths

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
Path ::= StableId
Expand Down Expand Up @@ -92,8 +90,7 @@ A path is one of the following.
A _stable identifier_ is a path which ends in an identifier.


Value Types
-----------
## Value Types

Every value in Scala has a type which is of one of the following
forms.
Expand Down Expand Up @@ -548,8 +545,7 @@ type.
`List[java.lang.Number]`.


Non-Value Types
---------------
## Non-Value Types

The types explained in the following do not denote sets of values, nor
do they appear explicitly in programs. They are introduced in this
Expand Down Expand Up @@ -641,8 +637,7 @@ the corresponding type parameter clause.
`newType` type constructor parameter in `flatMap`.


Base Types and Member Definitions
---------------------------------
## Base Types and Member Definitions

Types of class members depend on the way the members are referenced.
Central here are three notions, namely:
Expand Down Expand Up @@ -737,8 +732,7 @@ These notions are defined mutually recursively as follows.
share a to


Relations between types
-----------------------
## Relations between types

We define two relations between types.

Expand Down Expand Up @@ -939,8 +933,7 @@ A _weak least upper bound_ is a least upper bound with respect to
weak conformance.


Volatile Types
--------------
## Volatile Types

Type volatility approximates the possibility that a type parameter or abstract
type instance
Expand Down Expand Up @@ -975,8 +968,7 @@ An existential type `$T$ forSome {$\,Q\,$}` is volatile if
$T$ is volatile.


Type Erasure
------------
## Type Erasure

A type is called _generic_ if it contains type arguments or type variables.
_Type erasure_ is a mapping from (possibly generic) types to
Expand Down
24 changes: 8 additions & 16 deletions 06-basic-declarations-and-definitions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Basic Declarations and Definitions
==================================
# Basic Declarations and Definitions


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
Expand Down Expand Up @@ -36,8 +35,7 @@ between and including $s_i$ and $s_j$,
- If $s_k$ is a value definition, it must be lazy.


Value Declarations and Definitions
----------------------------------
## Value Declarations and Definitions

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
Dcl ::= ‘val’ ValDcl
Expand Down Expand Up @@ -133,8 +131,7 @@ A value definition `val $p_1 , \ldots , p_n: T$ = $e$` is a shorthand for the
sequence of value definitions `val $p_1: T$ = $e$; ...; val $p_n: T$ = $e$`.


Variable Declarations and Definitions
-------------------------------------
## Variable Declarations and Definitions

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.scala}
Dcl ::= ‘var’ VarDcl
Expand Down Expand Up @@ -236,8 +233,7 @@ A variable definition `var $x_1 , \ldots , x_n: T$ = $e$` is a shorthand for
the sequence of variable definitions
`var $x_1: T$ = $e$; ...; var $x_n: T$ = $e$`.

Type Declarations and Type Aliases
----------------------------------
## Type Declarations and Type Aliases

<!-- TODO: Higher-kinded tdecls should have a separate section -->

Expand Down Expand Up @@ -334,8 +330,7 @@ objects of type $S$.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Type Parameters
---------------
## Type Parameters

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.scala}
TypeParamClause ::= ‘[’ VariantTypeParam {‘,’ VariantTypeParam} ‘]’
Expand Down Expand Up @@ -398,8 +393,7 @@ The above scoping restrictions are generalized to the case of nested type parame
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Variance Annotations
--------------------
## Variance Annotations

Variance annotations indicate how instances of parameterized types
vary with respect to [subtyping](#conformance). A
Expand Down Expand Up @@ -519,8 +513,7 @@ appear anywhere without restricting its legal variance annotations.
on which one can write only strings.


Function Declarations and Definitions
-------------------------------------
## Function Declarations and Definitions

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
Dcl ::= ‘def’ FunDcl
Expand Down Expand Up @@ -768,8 +761,7 @@ as $R$ conforms to $R'$.
in `C`, even though the method is recursive.


Import Clauses
--------------
## Import Clauses

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.scala}
Import ::= ‘import’ ImportExpr {‘,’ ImportExpr}
Expand Down
18 changes: 6 additions & 12 deletions 07-classes-and-objects.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Classes and Objects
===================
# Classes and Objects

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
TmplDef ::= [`case'] `class' ClassDef
Expand All @@ -11,8 +10,7 @@ TmplDef ::= [`case'] `class' ClassDef
are both defined in terms of _templates_.


Templates
---------
## Templates

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
ClassTemplate ::= [EarlyDefs] ClassParents [TemplateBody]
Expand Down Expand Up @@ -485,8 +483,7 @@ before the superclass constructor of the template is called.
`"How are you, <null>"`.


Modifiers
---------
## Modifiers

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
Modifier ::= LocalModifier
Expand Down Expand Up @@ -676,8 +673,7 @@ the validity and meaning of a modifier are as follows.
constructor `private` (see \ref{ex:private-constr}).


Class Definitions
-----------------
## Class Definitions

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
TmplDef ::= `class' ClassDef
Expand Down Expand Up @@ -853,8 +849,7 @@ primary constructor of the class).
third one constructs a list with a given head and tail.


Case Classes
------------
## Case Classes

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
TmplDef ::= `case' `class' ClassDef
Expand Down Expand Up @@ -1090,8 +1085,7 @@ least proper supertype (which is statically known).
in `MyTable`.


Object Definitions
------------------
## Object Definitions

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.grammar}
ObjectDef ::= id ClassTemplate
Expand Down
Loading

0 comments on commit df2f3f7

Please sign in to comment.