summaryrefslogtreecommitdiff
path: root/03-lexical-syntax.md
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2014-03-10 17:31:12 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-03-10 19:20:05 -0700
commit90314673008a3bf765cf72d8cbbd3c691f27af03 (patch)
tree650cc5babe9101eb4d6e814875c43555783787e6 /03-lexical-syntax.md
parent21ca2cf9d8e39274934f2dca79c8ee8eda024ae3 (diff)
downloadscala-90314673008a3bf765cf72d8cbbd3c691f27af03.tar.gz
scala-90314673008a3bf765cf72d8cbbd3c691f27af03.tar.bz2
scala-90314673008a3bf765cf72d8cbbd3c691f27af03.zip
Catch up with latex spec.
Diffstat (limited to '03-lexical-syntax.md')
-rw-r--r--03-lexical-syntax.md21
1 files changed, 10 insertions, 11 deletions
diff --git a/03-lexical-syntax.md b/03-lexical-syntax.md
index 7f4614f387..f40e0f6d86 100644
--- a/03-lexical-syntax.md
+++ b/03-lexical-syntax.md
@@ -42,7 +42,7 @@ plainid ::= upper idrest
| varid
| op
id ::= plainid
- | ‘`’ stringLit ‘`’
+ | ‘`’ stringLiteral ‘`’
idrest ::= {letter | digit} [‘_’ op]
```
@@ -347,15 +347,15 @@ is _pt_. The numeric ranges given by these types are:
(@) Here are some integer literals:
- ```
- 0 21 0xFFFFFFFF 0777L
- ```
+```
+0 21 0xFFFFFFFF -42L
+```
### Floating Point Literals
```
-floatingPointLiteral ::= digit {digit} ‘.’ {digit} [exponentPart] [floatType]
+floatingPointLiteral ::= digit {digit} ‘.’ digit {digit} [exponentPart] [floatType]
| ‘.’ digit {digit} [exponentPart] [floatType]
| digit {digit} exponentPart [floatType]
| digit {digit} [exponentPart] floatType
@@ -381,11 +381,10 @@ whitespace character between the two tokens.
```
(@) The phrase `1.toString` parses as three different tokens:
- `1`, `.`, and `toString`. On the
- other hand, if a space is inserted after the period, the phrase
- `1. toString` parses as the floating point literal
- `1.` followed by the identifier `toString`.
+ the integer literal `1`, a `.`, and the identifier `toString`.
+(@) `1.` is not a valid floating point literal, because the
+ mandatory digit after the `.` is missing.
### Boolean Literals
@@ -479,8 +478,8 @@ The expression
```
"""the present string
- spans three
- lines.""".stripMargin
+ |spans three
+ |lines.""".stripMargin
```
evaluates to