Skip to content

Commit

Permalink
feat(rust): init modules
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Nov 18, 2022
1 parent 4ed75de commit a68bf2e
Show file tree
Hide file tree
Showing 11 changed files with 1,707 additions and 12 deletions.
33 changes: 25 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,38 @@ Chapi => Cha Pi => Tea Pi => Tea π => 茶 π. See on in refs: [Tea if by sea, c

Languages Stages (Welcome to PR your usage languages)

| Features/Languages | Java | Python | Go | Kotlin | TypeScript | C | C# | Scala | C++ |
|---------------------|------|--------|-----|--------|------------|-----|-----|-------|-----|
| http api decl || 🆕 | 🆕 ||| 🆕 | 🆕 | | |
| syntax parse |||||| 🆕 | 🆕 || 🆕 |
| function call || 🆕 | 🆕 | 🆕 || | | | |
| arch/package || | ||| | || |
| real world validate || | | 🆕 || | | | |
| Features/Languages | Java | Python | Go | Kotlin | TypeScript | C | C# | Scala | C++ | Rust |
|---------------------|------|--------|-----|--------|------------|-----|-----|-------|-----|------|
| http api decl || 🆕 | 🆕 ||| 🆕 | 🆕 | | | |
| syntax parse |||||| 🆕 | 🆕 || 🆕 | |
| function call || 🆕 | 🆕 | 🆕 || | | | | |
| arch/package || | ||| | || | |
| real world validate || | | 🆕 || | | | | |
| expression (TBD) | | | | | | | | | |

language versions(tested):

- Java: 8, 11, 17
- C#: .NET 6.0
- TypeScript
- Kotlin
- Python: 2, 3

// tier 1 languages
":chapi-ast-java",
":chapi-ast-typescript",

// tier 2 languages
":chapi-ast-kotlin",
":chapi-ast-go",
":chapi-ast-python",
":chapi-ast-scala",

// tier 3 languages
":chapi-ast-rust",
":chapi-ast-csharp",
":chapi-ast-c",
":chapi-ast-cpp",

Language Family [wiki](https://en.wikipedia.org/wiki/First-class_function)

Algol Family [https://wiki.c2.com/?AlgolFamily](https://wiki.c2.com/?AlgolFamily)
Expand Down
61 changes: 61 additions & 0 deletions chapi-ast-rust/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
plugins {
id("antlr")
java
kotlin("jvm")
kotlin("plugin.serialization") version "1.6.10"

`jacoco-conventions`
}

repositories {
mavenCentral()
mavenLocal()
}

dependencies {
antlr("org.antlr:antlr4:4.11.1")

// project deps
implementation(project(":chapi-domain"))

implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")

implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))
// Kotlin reflection.
implementation(kotlin("test"))
implementation(kotlin("test-junit"))

// JUnit 5
testImplementation("org.junit.jupiter:junit-jupiter-api:5.6.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.6.0")
testRuntimeOnly("org.junit.platform:junit-platform-console:1.6.0")

implementation("org.antlr:antlr4:4.11.1")
implementation("org.antlr:antlr4-runtime:4.11.1")
}

sourceSets.main {
java.srcDirs("${project.buildDir}/generated-src")
}

tasks.generateGrammarSource {
maxHeapSize = "64m"
arguments = arguments + listOf("-package", "chapi.ast.antlr") + listOf("-visitor", "-long-messages")
outputDirectory = file("${project.buildDir}/generated-src/chapi/ast/antlr")
}

tasks.withType<AntlrTask> {

}

tasks.named("compileKotlin") {
dependsOn(tasks.withType<AntlrTask>())
}

tasks.withType<Test> {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
Loading

0 comments on commit a68bf2e

Please sign in to comment.