summaryrefslogtreecommitdiff
path: root/03-lexical-syntax.md
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2014-03-10 20:03:21 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-03-10 20:03:21 -0700
commit1ca209508a77e833408987c5d95d5c490edf59a3 (patch)
treed53cde081253480fa43df5200de146322934f7d5 /03-lexical-syntax.md
parentb75812d518cf672c90a903b33625f52c75b3c8f9 (diff)
downloadscala-1ca209508a77e833408987c5d95d5c490edf59a3.tar.gz
scala-1ca209508a77e833408987c5d95d5c490edf59a3.tar.bz2
scala-1ca209508a77e833408987c5d95d5c490edf59a3.zip
formatting
Diffstat (limited to '03-lexical-syntax.md')
-rw-r--r--03-lexical-syntax.md29
1 files changed, 13 insertions, 16 deletions
diff --git a/03-lexical-syntax.md b/03-lexical-syntax.md
index f40e0f6d86..28919f8b14 100644
--- a/03-lexical-syntax.md
+++ b/03-lexical-syntax.md
@@ -19,19 +19,17 @@ hexDigit ::= ‘0’ | … | ‘9’ | ‘A’ | … | ‘F’ | ‘a’ |
To construct tokens, characters are distinguished according to the following
classes (Unicode general category given in parentheses):
-1. Whitespace characters. `\u0020 | \u0009 | \u000D | \u000A`
-1. Letters, which include lower case letters(Ll), upper case letters(Lu),
- titlecase letters(Lt), other letters(Lo), letter numerals(Nl) and the
- two characters \\u0024 ‘\\$’ and \\u005F ‘_’, which both count as upper case
- letters
-1. Digits `‘0’ | … | ‘9’`
-1. Parentheses `‘(’ | ‘)’ | ‘[’ | ‘]’ | ‘{’ | ‘}’ `
-1. Delimiter characters ``‘`’ | ‘'’ | ‘"’ | ‘.’ | ‘;’ | ‘,’ ``
+1. Whitespace characters. `\u0020 | \u0009 | \u000D | \u000A`.
+1. Letters, which include lower case letters (`Ll`), upper case letters (`Lu`),
+ titlecase letters (`Lt`), other letters (`Lo`), letter numerals (`Nl`) and the
+ two characters `\u0024` `‘$’` and `\u005F` `‘_’`, which both count as upper case
+ letters.
+1. Digits `‘0’ | … | ‘9’`.
+1. Parentheses `‘(’ | ‘)’ | ‘[’ | ‘]’ | ‘{’ | ‘}’ `.
+1. Delimiter characters ``‘`’ | ‘'’ | ‘"’ | ‘.’ | ‘;’ | ‘,’ ``.
1. Operator characters. These consist of all printable ASCII characters
- \\u0020-\\u007F which are in none of the sets above, mathematical symbols(Sm)
- and other symbols(So).
-
-\pagebreak[1]
+ `\u0020 - \u007F` which are in none of the sets above, mathematical symbols (`Sm`)
+ and other symbols (`So`).
## Identifiers
@@ -48,7 +46,7 @@ idrest ::= {letter | digit} [‘_’ op]
There are three ways to form an identifier. First, an identifier can
start with a letter which can be followed by an arbitrary sequence of
-letters and digits. This may be followed by underscore ‘_’
+letters and digits. This may be followed by underscore `‘_’`
characters and another string composed of either letters and digits or
of operator characters. Second, an identifier can start with an operator
character followed by an arbitrary sequence of operator characters.
@@ -69,9 +67,8 @@ decomposes into the three identifiers `big_bob`, `++=`, and
_variable identifiers_, which start with a lower case letter, and
_constant identifiers_, which do not.
-The ‘\$’ character is reserved
-for compiler-synthesized identifiers. User programs should not define
-identifiers which contain ‘\$’ characters.
+The `‘$’` character is reserved for compiler-synthesized identifiers.
+User programs should not define identifiers which contain `‘$’` characters.
The following names are reserved words instead of being members of the
syntactic class `id` of lexical identifiers.