Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
__pycache__
.DS_Store
kotlin/do-test*
swift/do-test
do-test*
local.properties
.gradle
build
test/test-dir/entities.kt
test-dir/entities.kt
7 changes: 7 additions & 0 deletions CHANELOG.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [2.0](https://github.com/OGStudio/kotlin-dialect/pull/13)

TODO

1. The project has been renamed to Kotlin Dialect to emphasize....
1. Version 1.x has been moved to history/2025

# [1.3.0](https://github.com/OGStudio/cross-language-dialect/pull/12)
#### 2026-01-22

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
69 changes: 69 additions & 0 deletions history/2025/test/test-dir/entities.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package org.opengamestudio

// Application state context
data class Context(
// Command line arguments
var arguments: Array<String> = arrayOf(),
var consoleOutput: String = "",
var didLaunch: Boolean = false,
// Dictionary of dictionaries
var entityFieldComments: Map<Int, Map<String, String>> = mapOf(),
var httpDefaultPort: Int = 0,
var httpRequest: NetRequest = NetRequest(),
override var recentField: String = "",
): CLDContext {
override fun <T> field(name: String): T {
if (name == "arguments") {
return arguments as T
} else if (name == "consoleOutput") {
return consoleOutput as T
} else if (name == "didLaunch") {
return didLaunch as T
} else if (name == "entityFieldComments") {
return entityFieldComments as T
} else if (name == "httpDefaultPort") {
return httpDefaultPort as T
} else if (name == "httpRequest") {
return httpRequest as T
}
return "unknown-field-name" as T
}

override fun selfCopy(): CLDContext {
return this.copy()
}

override fun setField(
name: String,
value: Any?
) {
if (name == "arguments") {
arguments = value as Array<String>
} else if (name == "consoleOutput") {
consoleOutput = value as String
} else if (name == "didLaunch") {
didLaunch = value as Boolean
} else if (name == "entityFieldComments") {
entityFieldComments = value as Map<Int, Map<String, String>>
} else if (name == "httpDefaultPort") {
httpDefaultPort = value as Int
} else if (name == "httpRequest") {
httpRequest = value as NetRequest
}
}
}


data class FSFile(
var isDirectory: Boolean = false,
var isFile: Boolean = false,
var name: String = "",
) {}

// Network request representation
data class NetRequest(
var body: String = "",
// GET, POST, etc.
var method: String = "",
var path: String = "",
) {}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 0 additions & 23 deletions history/ctx/do-test.py

This file was deleted.

20 changes: 0 additions & 20 deletions history/lib/do-test.py

This file was deleted.

24 changes: 0 additions & 24 deletions history/tr/do-test.py

This file was deleted.

12 changes: 0 additions & 12 deletions javascript/do-test.html

This file was deleted.

30 changes: 30 additions & 0 deletions klin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 1

kotlin: package org.opengamestudio

AppContext:
type: context
fields:
# Command line arguments
arguments: [String]
consoleOutput: String
didLaunch: Bool
# Entity comments with entities referenced by index
entityComments: [Int: String]
# Entity id -> Field name -> Field comment
entityFieldComments: [Int: [String: String]]
# Entity id -> Field name -> Field type
entityFields: [Int: [String: String]]
# Entity names in the order of appearance
entityNames: [String]
entityPrefixesKotlin: [Int: String]
entityTypes: [Int: String]
didWriteOutputFile: Bool
inputFile: String
inputFileLines: [String]
isDbg: Bool
outputFile: String
# Contents to write to output file
outputFileContents: String
# Kotlin source code to insert as is at the beginning of each generated file
rawKotlin: String
22 changes: 22 additions & 0 deletions klin/ver-nodejs/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
plugins {
alias(libs.plugins.kotlin.multiplatform)
}

kotlin {
js {
nodejs { }
binaries.executable()
}

sourceSets {
all {
languageSettings {
optIn("kotlin.js.ExperimentalJsExport")
}
}
}
}

tasks.withType<Wrapper> {
distributionType = Wrapper.DistributionType.BIN
}
Loading