Skip to content

Commit b038228

Browse files
committed
Merge pull request #165 from densh/topic/gsoc-xml
Minor changes to GSOC'14 proposal regarding XML Interpolator
2 parents 7b83525 + 2a6532c commit b038228

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

gsoc/2014.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,26 +230,29 @@ Scala features XML literals which desugar to calls of the XML
230230
library. The support for XML literals is part of the parser and the
231231
compiler, and are bound to a single desugared API. Scala 2.10 added
232232
support for generic, customizable string interpolators. Standard ones
233-
are `s"foo = $foo"` or `f"bar = $bar%.2f"`. Quasiquotes, added in
234-
Scala 2.11, show that these interpolators can be implemented by
233+
are `s"foo = $foo"` or `f"bar = $bar%.2f"`.
234+
[Quasi-quotes](http://docs.scala-lang.org/overviews/macros/quasiquotes.html),
235+
added in Scala 2.11, show that these interpolators can be implemented by
235236
macros to support compile-time checking of the syntax inside an
236237
interpolator.
237238

238239
The goal of this project is to design and implement a macro-based
239240
generic XML string interpolator. It should be primarily designed as a
240241
replacement for the XML literal syntax of Scala, and hence would
241242
provide at least all the features of that syntax. For example, the XML
242-
literal
243+
literals
243244

244245
val name = "John"
245246
val span = <span>{ name }</span>
246247
val node = <div>{ span }</div>
248+
node match { case <div><span>{ inner }</span></div> => inner }
247249

248250
could be rewritten as
249251

250252
val name = "John"
251253
val span = xml"<span>$name</span>"
252254
val node = xml"<div>$span</div>"
255+
node match { case xml"<div><span>$inner</span></div>" => inner }
253256

254257
As an additional requirement, this interpolator should be generic with
255258
respect to the actual API that is called by the generated code, called
@@ -264,8 +267,8 @@ the code.
264267

265268
Required skills:
266269
* Good working knowledge of Scala
267-
* Basic knowledge of def macros and quasiquotes in Scala 2.11
268270
* Good knowledge of XML
271+
* Basic knowledge of [def macros](http://docs.scala-lang.org/overviews/macros/overview.html)
269272

270273
Mentored by
271274
[Sébastien Doeraene](http://people.epfl.ch/sebastien.doeraene)

0 commit comments

Comments
 (0)