diff --git a/core/src/main/scala-latest-js/scalameta_ast/MainCompat.scala b/core/src/main/scala-latest-js/scalameta_ast/MainCompat.scala index a646e0d..cb1915c 100644 --- a/core/src/main/scala-latest-js/scalameta_ast/MainCompat.scala +++ b/core/src/main/scala-latest-js/scalameta_ast/MainCompat.scala @@ -139,7 +139,13 @@ trait MainCompat { import scala.meta._ val convert = implicitly[Convert[String, Input]] val main = new ScalametaAST - val dialects = List(scala.meta.dialects.Scala3) + val dialects = + main.stringToDialects.getOrElse( + dialect, { + Console.err.println(s"invalid dialct ${dialect}") + main.dialectsDefault + } + ) val input = convert.apply(src) val tree: Tree = main.loopParse(