feat: <scala> add some dsl use case

上级 27bf3f88
package chapi.ast.scalaast
import chapi.domain.core.DataStructType
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import kotlin.test.assertEquals
......@@ -67,4 +68,19 @@ class Outer(i : Int) {
assertEquals(container.DataStructures[0].InnerStructures[0].Type, DataStructType.OBJECT)
assertEquals(container.DataStructures[0].InnerStructures[0].NodeName, "Inner")
}
@Test
internal fun shouldIdentExtendClassName() {
}
@Test
internal fun shouldIdentTraitName() {
}
@Test
internal fun shouldIdentMultipleTraitName() {
}
}
// https://gist.github.com/nicerobot/4189552
object Story {
object Once { def upon = (x: a.type) => x }
object a { def time = (x: languages.type) => x }
object languages { def were = (x: inflexible.type) => x }
object inflexible { def along = (x: came.type) => x }
object came { def Scala = (x: inflexible.type) => x }
implicit def string(s : String) : inflexible.type = inflexible
def main(args: Array[String]): Unit = {
Once upon a time languages were inflexible; "Then " along came Scala ". The End!"
}
}
......@@ -14,7 +14,8 @@ enum class DataStructType (val structType: String) {
OBJECT("Object"),
INNERSTRUCTURES("InnerStructures"),
CREATORCLASS("CreatorClass"),
ABSTRACTCLASS("AbstractClass")
ABSTRACTCLASS("AbstractClass"),
TRAIT("Trait") // for scala
}
@Serializable
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册