summaryrefslogtreecommitdiff
path: root/scalatexApi/src/main/scala/scalatex/stages/Compiler.scala
diff options
context:
space:
mode:
Diffstat (limited to 'scalatexApi/src/main/scala/scalatex/stages/Compiler.scala')
-rw-r--r--scalatexApi/src/main/scala/scalatex/stages/Compiler.scala9
1 files changed, 5 insertions, 4 deletions
diff --git a/scalatexApi/src/main/scala/scalatex/stages/Compiler.scala b/scalatexApi/src/main/scala/scalatex/stages/Compiler.scala
index 19cec10..5704b2c 100644
--- a/scalatexApi/src/main/scala/scalatex/stages/Compiler.scala
+++ b/scalatexApi/src/main/scala/scalatex/stages/Compiler.scala
@@ -25,17 +25,18 @@ object Compiler{
case (curr, Ast.Chain.TypeArgs(str, offset2)) =>
val TypeApply(fun, args) = c.parse(s"omg$str")
TypeApply(curr, args)
- case (curr, Ast.Block(parts, offset)) =>
- q"$curr(..${compileBlock(parts, offset)})"
+ case (curr, Ast.Block(front, parts, offset)) =>
+ q"$curr(..${compileBlock(front, parts, offset)})"
}
}
- def compileBlock(parts: Seq[Ast.Block.Sub], offset: Int): Seq[c.Tree] = {
+ def compileBlock(front: Option[String], parts: Seq[Ast.Block.Sub], offset: Int): Seq[c.Tree] = {
parts.map{
case Ast.Block.Text(str, offset2) => q"$str"
case Ast.Chain(code, parts, offset) => compileChain(code, parts, offset)
+
}
}
- val res = q"Seq[$fragType](..${compileBlock(template.parts, template.offset)})"
+ val res = q"Seq[$fragType](..${compileBlock(None, template.parts, template.offset)})"
println("::::::::::::::::::::::::::::::::::::::::::::::::")
println(res)
println("::::::::::::::::::::::::::::::::::::::::::::::::")