@@ -230,26 +230,29 @@ Scala features XML literals which desugar to calls of the XML
230
230
library. The support for XML literals is part of the parser and the
231
231
compiler, and are bound to a single desugared API. Scala 2.10 added
232
232
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
235
236
macros to support compile-time checking of the syntax inside an
236
237
interpolator.
237
238
238
239
The goal of this project is to design and implement a macro-based
239
240
generic XML string interpolator. It should be primarily designed as a
240
241
replacement for the XML literal syntax of Scala, and hence would
241
242
provide at least all the features of that syntax. For example, the XML
242
- literal
243
+ literals
243
244
244
245
val name = "John"
245
246
val span = <span>{ name }</span>
246
247
val node = <div>{ span }</div>
248
+ node match { case <div><span>{ inner }</span></div> => inner }
247
249
248
250
could be rewritten as
249
251
250
252
val name = "John"
251
253
val span = xml"<span>$name</span>"
252
254
val node = xml"<div>$span</div>"
255
+ node match { case xml"<div><span>$inner</span></div>" => inner }
253
256
254
257
As an additional requirement, this interpolator should be generic with
255
258
respect to the actual API that is called by the generated code, called
@@ -264,8 +267,8 @@ the code.
264
267
265
268
Required skills:
266
269
* Good working knowledge of Scala
267
- * Basic knowledge of def macros and quasiquotes in Scala 2.11
268
270
* Good knowledge of XML
271
+ * Basic knowledge of [ def macros] ( http://docs.scala-lang.org/overviews/macros/overview.html )
269
272
270
273
Mentored by
271
274
[ Sébastien Doeraene] ( http://people.epfl.ch/sebastien.doeraene )
0 commit comments