Skip to content

Commit

Permalink
Mark tests that rely on local mutable state, regions, or bidirectiona…
Browse files Browse the repository at this point in the history
…l effects
  • Loading branch information
b-studios committed Nov 27, 2023
1 parent 514b089 commit 590b995
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 4 deletions.
57 changes: 57 additions & 0 deletions effekt/jvm/src/test/scala/effekt/JavaScriptTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,63 @@ class JavaScriptTests extends EffektTests {
// we deprecated locally defined type and effect declarations, for now.
examplesDir / "neg" / "existential_effect_leaks.effekt",
examplesDir / "neg" / "scoped.effekt",

// Missing features in new direct style backend:
// ---------------------------------------------

// (local) mutable variables
examplesDir / "pos" / "nim.effekt",
examplesDir / "pos" / "propagators.effekt",
examplesDir / "benchmarks" / "triples.effekt",
examplesDir / "benchmarks" / "nqueens.effekt",
examplesDir / "benchmarks" / "simple_counter.effekt",
examplesDir / "benchmarks" / "tree.effekt",
examplesDir / "casestudies"/ "prettyprinter.md",
examplesDir / "casestudies"/ "lexer.md",
examplesDir / "casestudies"/ "parser.md",
examplesDir / "casestudies"/ "naturalisticdsls.md",
examplesDir / "casestudies"/ "buildsystem.md",
examplesDir / "casestudies"/ "anf.md",
examplesDir / "pos" / "issue108.effekt",
examplesDir / "pos" / "overloading.effekt",
examplesDir / "pos" / "unsafe_cont.effekt",
examplesDir / "pos" / "type_parameters_blocks.effekt",
examplesDir / "pos" / "stacksafe.effekt",
examplesDir / "pos" / "build.effekt",
examplesDir / "pos" / "type_parameter_blocks.effekt",
examplesDir / "pos" / "capture" / "mbed.effekt",
examplesDir / "pos" / "mutable.effekt",
examplesDir / "pos" / "sideeffects.effekt",
examplesDir / "pos" / "arrays.effekt",
examplesDir / "pos" / "simpleparser.effekt",
examplesDir / "pos" / "higherorder_io_control.effekt",
examplesDir / "pos" / "dequeue.effekt",
examplesDir / "pos" / "matchblock.effekt",
examplesDir / "pos" / "multihandler.effekt",
examplesDir / "pos" / "state.effekt",
examplesDir / "pos" / "parser.effekt",
examplesDir / "pos" / "stream_push.effekt",
examplesDir / "pos" / "stream_pull.effekt",
examplesDir / "pos" / "probabilistic.effekt",
examplesDir / "pos" / "multieffects.effekt",
examplesDir / "pos" / "imports.effekt",
examplesDir / "pos" / "withstatement.effekt",
examplesDir / "pos" / "raytracer.effekt",
examplesDir / "pos" / "lambdas" / "generators.effekt",
examplesDir / "pos" / "lambdas" / "localstate.effekt",
examplesDir / "pos" / "lambdas" / "scheduler.effekt",

// bidirectional
examplesDir / "pos" / "bidirectional" / "iterators.effekt",
examplesDir / "pos" / "bidirectional" / "pingpong.effekt",

// regions
examplesDir / "benchmarks" / "generator.effekt",
examplesDir / "pos" / "recursiveobject.effekt",
examplesDir / "pos" / "capture" / "regions.effekt",
examplesDir / "pos" / "liftinference.effekt",
examplesDir / "pos" / "capture" / "selfregion.effekt"

)
}

Expand Down
2 changes: 1 addition & 1 deletion effekt/shared/src/main/scala/effekt/core/Transformer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ object Transformer extends Phase[Typechecked, CoreTransformed] {
core.ValueParam(id, transform(Context.valueTypeOf(id)))

def BlockParam(id: BlockSymbol)(using Context): core.BlockParam =
core.BlockParam(id, transform(Context.blockTypeOf(id)), transform(Context.captureOf(id)))
core.BlockParam(id, transform(Context.blockTypeOf(id)), Set(id))

def ValueVar(id: ValueSymbol)(using Context): core.ValueVar =
core.ValueVar(id, transform(Context.valueTypeOf(id)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ object TransformerDS {
Context.panic("Not implemented yet")

case Hole() =>
Context.panic("Not implemented yet")
Return(js.builtin("hole"))

case Get(id, capt, tpe) => Context.panic("Should have been translated to direct style")
case Put(id, capt, value) => Context.panic("Should have been translated to direct style")
Expand Down
4 changes: 2 additions & 2 deletions libraries/js/io/async.effekt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extern io def readPromise(path: String): Promise[String] =
"fsPromises.readFile(path, 'utf8')"

extern io def awaitPromise[T, R](p: Promise[T], cont: T => R at {io}): R =
"p.then(res => cont(res).run())"
"p.then(cont)"

extern io def fork(process: () => Unit at {io}): Unit =
"setTimeout(() => process().run(), 0)"
"setTimeout(() => process(), 0)"

0 comments on commit 590b995

Please sign in to comment.