Permalink
Browse files

formatting

  • Loading branch information...
1 parent 9c757bb commit d8a09e207cb207f185cae035247bdcc6d71cbfca @adriaanm adriaanm committed Mar 13, 2014
Showing with 15 additions and 13 deletions.
  1. +6 −5 03-lexical-syntax.md
  2. +9 −8 12-xml-expressions-and-patterns.md
View
@@ -1,12 +1,13 @@
---
title: Lexical Syntax
layout: default
+tag: lexical
---
# Lexical Syntax
Scala programs are written using the Unicode Basic Multilingual Plane
-(_BMP_) character set; Unicode supplementary characters are not
+( _BMP_ ) character set; Unicode supplementary characters are not
presently supported. This chapter defines the two modes of Scala's
lexical syntax, the Scala mode and the _XML_ mode. If not
otherwise mentioned, the following descriptions of Scala tokens refer
@@ -97,8 +98,8 @@ var while with yield
_ : = => <- <: <% >: # @
```
-The Unicode operators \\u21D2 $\Rightarrow$ and \\u2190 $\leftarrow$, which have the ASCII
-equivalents ‘=>’ and ‘<-’, are also reserved.
+The Unicode operators `\u21D2 $\Rightarrow$` and `\u2190 $\leftarrow$`, which have the ASCII
+equivalents `=>` and `<-`, are also reserved.
###### Example: here are some identifiers:
@@ -349,12 +350,12 @@ and the integer number fits in the numeric range defined by the type,
then the number is converted to type _pt_ and the literal's type
is _pt_. The numeric ranges given by these types are:
-| | |
+| | |
|----------------|------------------------|
|`Byte` | $-2^7$ to $2^7-1$ |
|`Short` | $-2^{15}$ to $2^{15}-1$|
|`Char` | $0$ to $2^{16}-1$ |
-| |
+
###### Example: some integer literals
@@ -14,7 +14,7 @@ changes being mandated by the possibility of embedding Scala code fragments.
## XML expressions
XML expressions are expressions generated by the following production, where the
-opening bracket `<' of the first element must be in a position to start the lexical
+opening bracket `<` of the first element must be in a position to start the lexical
[XML mode](#xml-mode).
```
@@ -63,7 +63,7 @@ corresponding Scala runtime class.
By default, beginning and trailing whitespace in element content is removed,
and consecutive occurrences of whitespace are replaced by a single space
-character \\u0020. This behavior can be changed to preserve all whitespace
+character `\u0020`. This behavior can be changed to preserve all whitespace
with a compiler option.
```
@@ -79,12 +79,13 @@ CharData ::= { CharNoRef } $\mbox{\rm\em without}$ {CharNoRef}`{'CharB {C
$\mbox{\rm\em and without}$ {CharNoRef}`]]>'{CharNoRef}
```
+<!-- {% raw %} stupid liquid borks on the double brace below; brace yourself, liquid! -->
XML expressions may contain Scala expressions as attribute values or
within nodes. In the latter case, these are embedded using a single opening
-brace ‘{’ and ended by a closing brace ‘}’. To express a single opening braces
-within XML text as generated by CharData, it must be doubled. Thus, ‘{{’
-represents the XML text ‘{’ and does not introduce an embedded Scala
-expression.
+brace `{` and ended by a closing brace `}`. To express a single opening braces
+within XML text as generated by CharData, it must be doubled.
+Thus, `{{` represents the XML text `{` and does not introduce an embedded Scala expression.
+<!-- {% endraw %} -->
```
BaseChar, Char, Comment, CombiningChar, Ideographic, NameChar, S, Reference
@@ -104,7 +105,7 @@ XNameStart ::= ‘_’ | BaseChar | Ideographic
## XML patterns
XML patterns are patterns generated by the following production, where
-the opening bracket ‘<’ of the element patterns must be in a position
+the opening bracket `<` of the element patterns must be in a position
to start the lexical [XML mode](#xml-mode).
```
@@ -123,7 +124,7 @@ Whitespace is treated the same way as in XML expressions.
By default, beginning and trailing whitespace in element content is removed,
and consecutive occurrences of whitespace are replaced by a single space
-character \\u0020. This behavior can be changed to preserve all whitespace
+character `\u0020`. This behavior can be changed to preserve all whitespace
with a compiler option.
```

0 comments on commit d8a09e2

Please sign in to comment.