From 3b0c71df60a41e13e47ec9ae8dbc606e1928aba8 Mon Sep 17 00:00:00 2001 From: Antoine Gourlay Date: Mon, 15 Sep 2014 12:08:51 +0200 Subject: spec: remove trailing whitespace everywhere --- spec/10-xml-expressions-and-patterns.md | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'spec/10-xml-expressions-and-patterns.md') diff --git a/spec/10-xml-expressions-and-patterns.md b/spec/10-xml-expressions-and-patterns.md index 8d4b459844..069f499ce9 100644 --- a/spec/10-xml-expressions-and-patterns.md +++ b/spec/10-xml-expressions-and-patterns.md @@ -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 +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 [XML mode](01-lexical-syntax.html#xml-mode). @@ -29,13 +29,13 @@ related to entity resolution. The following productions describe Scala's extensible markup language, designed as close as possible to the W3C extensible markup language -standard. Only the productions for attribute values and character data are changed. +standard. Only the productions for attribute values and character data are changed. Scala does not support declarations, CDATA sections or processing instructions. Entity references are not resolved at runtime. ```ebnf Element ::= EmptyElemTag - | STag Content ETag + | STag Content ETag EmptyElemTag ::= ‘<’ Name {S Attribute} [S] ‘/>’ @@ -52,17 +52,17 @@ XmlContent ::= Element ``` If an XML expression is a single element, its value is a runtime -representation of an XML node (an instance of a subclass of +representation of an XML node (an instance of a subclass of `scala.xml.Node`). If the XML expression consists of more than one element, then its value is a runtime representation of a -sequence of XML nodes (an instance of a subclass of +sequence of XML nodes (an instance of a subclass of `scala.Seq[scala.xml.Node]`). -If an XML expression is an entity reference, CDATA section, processing -instructions or a comments, it is represented by an instance of the +If an XML expression is an entity reference, CDATA section, processing +instructions or a comments, it is represented by an instance of the corresponding Scala runtime class. -By default, beginning and trailing whitespace in element content is removed, +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 with a compiler option. @@ -76,13 +76,13 @@ AttValue ::= ‘"’ {CharQ | CharRef} ‘"’ ScalaExpr ::= Block -CharData ::= { CharNoRef } $\textit{ without}$ {CharNoRef}`{'CharB {CharNoRef} +CharData ::= { CharNoRef } $\textit{ without}$ {CharNoRef}`{'CharB {CharNoRef} $\textit{ and without}$ {CharNoRef}`]]>'{CharNoRef} ``` XML expressions may contain Scala expressions as attribute values or -within nodes. In the latter case, these are embedded using a single opening +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. @@ -99,7 +99,7 @@ CharB ::= Char1 $\textit{ without}$ ‘{’ Name ::= XNameStart {NameChar} -XNameStart ::= ‘_’ | BaseChar | Ideographic +XNameStart ::= ‘_’ | BaseChar | Ideographic $\textit{ (as in W3C XML, but without }$ ‘:’$)$ ``` @@ -110,7 +110,7 @@ the opening bracket `<` of the element patterns must be in a position to start the lexical [XML mode](01-lexical-syntax.html#xml-mode). ```ebnf -XmlPattern ::= ElementPattern +XmlPattern ::= ElementPattern ``` Well-formedness constraints of the XML specification apply. @@ -123,18 +123,18 @@ XML patterns may contain [Scala patterns](08-pattern-matching.html#pattern-match Whitespace is treated the same way as in XML expressions. -By default, beginning and trailing whitespace in element content is removed, +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 with a compiler option. ```ebnf ElemPattern ::= EmptyElemTagP - | STagP ContentP ETagP + | STagP ContentP ETagP EmptyElemTagP ::= ‘<’ Name [S] ‘/>’ -STagP ::= ‘<’ Name [S] ‘>’ -ETagP ::= ‘’ +STagP ::= ‘<’ Name [S] ‘>’ +ETagP ::= ‘’ ContentP ::= [CharData] {(ElemPattern|ScalaPatterns) [CharData]} ContentP1 ::= ElemPattern | Reference @@ -144,4 +144,3 @@ ContentP1 ::= ElemPattern | ScalaPatterns ScalaPatterns ::= ‘{’ Patterns ‘}’ ``` - -- cgit v1.2.3