Skip to content

Commit

Permalink
updated to newer Scala 3 vararg pattern syntax
Browse files Browse the repository at this point in the history
Signed-off-by: Konstantin Läufer <laufer@cs.luc.edu>
  • Loading branch information
klaeufer committed Dec 17, 2023
1 parent 1937d2c commit 8dac51f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/scala/execute.scala
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ object Execute:
val lvalue = apply(store)(left)
val rvalue = apply(store)(right)
lvalue.set(rvalue.get)
case Sequence(statements @ _*) =>
case Sequence(statements*) =>
statements.foldLeft(Cell.NULL)((c, s) => apply(store)(s))
case While(guard, body) =>
var gvalue = apply(store)(guard)
Expand All @@ -79,8 +79,8 @@ object Execute:
Cell.NULL
case New(Clazz(zuper, fields, methods)) =>
// create an object based on the list of field names and methods
val fs = Map(fields.map(field => (field, Cell(0))): _*)
val ms = Map(methods: _*)
val fs = Map(fields.map(field => (field, Cell(0)))*)
val ms = Map(methods*)
val z = zuper map ((z: Clazz) => apply(Map.empty)(New(z)).get.toOption.get)
Cell(Right(Instance(z, fs, ms)))
case Selection(receiver, field) =>
Expand All @@ -93,7 +93,7 @@ object Execute:
rec.get.toOption.get.getField(field)
else
store("scope").get.toOption.get.getField(field)
case Message(receiver, method, arguments @ _*) =>
case Message(receiver, method, arguments*) =>
// evaluate receiver expression to a Cell containing an Instance
val rec = apply(store)(receiver)
// look up method in the Instance's second component (method table)
Expand Down

0 comments on commit 8dac51f

Please sign in to comment.