Skip to content

Commit af209fe

Browse files
committed
Update samples
1 parent ef68161 commit af209fe

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

chat/aspects/build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ sourceGenerators in Compile <+= (sourceDirectory in Compile, sourceManaged in Co
1212
forest.compiler.Compiler.compile(
1313
scalax.file.Path(sourceDir / "forest" / "Chat"),
1414
scalax.file.Path(targetDir),
15-
Seq("aspects._", "scala.virtualization.lms.common.{LiftAll, Structs, StringOps}"),
16-
Seq("Models", "LiftAll", "Structs", "StringOps")
15+
Seq("aspects._", "scala.virtualization.lms.common._", "scala.js._"),
16+
Seq("Models", "LiftJsScala")
1717
)
1818
(targetDir / "Chat.scala").get.map(_.getAbsoluteFile)
1919
}

chat/aspects/src/main/scala/aspects/Compiler.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import forest._
33
import js._
44

55
object Compiler extends App {
6-
new aspects.ChatUpdate with ForestPkgExp with TreeManipulationExp with StructExp with StringOpsExp { Ir =>
6+
new aspects.ChatUpdate with JsScalaExp with ForestExp with TreeManipulationExp { Ir =>
77
context = Nil
88
val out = new java.io.PrintWriter("../app/Chat-generated.scala") // That’s very bad.
99
out.println("package generated {")
10-
val scalaCodegen = new ScalaGenForestPkg with ScalaGenTreeManipulation with ScalaGenStruct with ScalaGenStringOps { val IR: Ir.type = Ir; stream = null }
10+
val scalaCodegen = new ScalaGenJsScala with ScalaGenForest with ScalaGenTreeManipulation { val IR: Ir.type = Ir; stream = null }
1111
val irChat = new ChatUpdate {}
1212
scalaCodegen.emitSource(irChat.connectedUser, "ConnectedUser", out)
1313
scalaCodegen.emitSource(irChat.chatRoom, "ChatRoom", out)
@@ -35,7 +35,7 @@ object Compiler extends App {
3535
out.close()
3636

3737
val outJs = new java.io.PrintWriter("../app/assets/javascripts/views.js") // Very bad, too.
38-
val jsCodegen = new JSGenForestPkg with JSGenTreeManipulation with JSGenStruct with JSGenStringOps { val IR: Ir.type = Ir; stream = null }
38+
val jsCodegen = new JSGenJsScala with JSGenForest with JSGenTreeManipulation { val IR: Ir.type = Ir; stream = null }
3939
outJs.println(";(function(){")
4040
jsCodegen.emitSource(irChat.connectedUser, "connectedUser", outJs)
4141
jsCodegen.emitSource((_: Exp[Unit]) => irChat.login, "login", outJs)

mindmap/aspects/build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ sourceGenerators in Compile <+= (sourceDirectory in Compile, sourceManaged in Co
1010
forest.compiler.Compiler.compile(
1111
scalax.file.Path(sourceDir / "forest" / "Templates"),
1212
scalax.file.Path(targetDir),
13-
Seq("models._", "scala.xml.Node", "scala.virtualization.lms.common._"),
14-
Seq("Models", "ScalaOpsPkg", "LiftScala")
13+
Seq("models._", "scala.xml.Node", "scala.virtualization.lms.common._", "scala.js._"),
14+
Seq("Models", "LiftJsScala")
1515
)
1616
(targetDir / "Templates.scala").get.map(_.getAbsoluteFile)
1717
}

mindmap/aspects/src/main/scala/CodeGenerator.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import js._
66
object CodeGenerator extends App {
77

88
trait Prog extends ir.Templates with views.Workspace with models.Models
9-
val prog = new Prog with ForestPkgExp with ScalaOpsPkgExp with StructExp with TupledFunctionsExp { context = Nil }
9+
val prog = new Prog with JsScalaExp with ForestExp { context = Nil }
1010
val templates = new prog.Templates {}
1111
val jsProg = new javascripts.BuildMap with models.Models with JSExp with ListOpsExp with StructExp { context = Nil }
1212
val jsProg2 = new javascripts.Exploration with JSExp with javascripts.ExtraJSExp { context = Nil }
1313

14-
val scalaGen = new ScalaGenForestPkg with ScalaCodeGenPkg with ScalaGenStruct { val IR: prog.type = prog; stream = null }
14+
val scalaGen = new ScalaGenJsScala with ScalaGenForest { val IR: prog.type = prog; stream = null }
1515
val scalaOut = new java.io.PrintWriter("../app/MindMap-generated.scala")
1616
scalaOut.println("package generated {")
1717
scalaGen.emitSource(templates.listMaps, "ListMaps", scalaOut)
@@ -43,10 +43,9 @@ object CodeGenerator extends App {
4343
scalaGen.remap(manifest[prog.Edge])))
4444
scalaOut.close()
4545

46-
val jsGen = new JSGenForestPkg with JSCodeGenPkg with JSGenStruct { val IR: prog.type = prog; stream = null }
46+
val jsGen = new JSGenJsScala with JSGenForest { val IR: prog.type = prog; stream = null }
4747
val jsGen2 = new JSGen with JSGenListOps with JSGenStruct {
4848
val IR: jsProg.type = jsProg; stream = null
49-
import IR._
5049
}
5150
val jsGen3 = new JSGen with javascripts.JSGenExtra { val IR: jsProg2.type = jsProg2; stream = null }
5251
val jsOut = new java.io.PrintWriter("../app/assets/javascripts/mindmap-generated.js")

mindmap/aspects/src/main/scala/views/Workspace.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import forest._
44
import scala.xml.Node
55
import scala.virtualization.lms.common._
66
import models._
7+
import scala.js._
78

8-
trait Workspace extends ForestPkg with ScalaOpsPkg with LiftScala { this: Models =>
9+
trait Workspace extends JsScala with Forest with LiftJsScala { this: Models =>
910

1011
def showMap(map: Rep[MindMap]): Rep[List[Node]] = {
1112
val defs = el('defs)(

0 commit comments

Comments
 (0)