mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2025-08-02 21:00:56 +00:00
upgrade dependencies
This commit is contained in:
parent
d2eaffafcc
commit
17b1aa44c0
11
.github/dependabot.yml
vendored
11
.github/dependabot.yml
vendored
@ -11,3 +11,14 @@ updates:
|
|||||||
actions-dev-updates:
|
actions-dev-updates:
|
||||||
dependency-type: development
|
dependency-type: development
|
||||||
applies-to: version-updates
|
applies-to: version-updates
|
||||||
|
- package-ecosystem: gradle
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
groups:
|
||||||
|
gradle-updates:
|
||||||
|
dependency-type: production
|
||||||
|
applies-to: version-updates
|
||||||
|
gradle-dev-updates:
|
||||||
|
dependency-type: development
|
||||||
|
applies-to: version-updates
|
||||||
|
@ -3,5 +3,5 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<Wrapper> {
|
tasks.withType<Wrapper> {
|
||||||
gradleVersion = "8.13"
|
gradleVersion = "8.14.2"
|
||||||
}
|
}
|
||||||
|
@ -13,10 +13,10 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.10")
|
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.2.0")
|
||||||
implementation("org.jetbrains.kotlin:kotlin-serialization:2.1.10")
|
implementation("org.jetbrains.kotlin:kotlin-serialization:2.2.0")
|
||||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1")
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2")
|
||||||
implementation("com.charleskorn.kaml:kaml:0.72.0")
|
implementation("com.charleskorn.kaml:kaml:0.83.0")
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
9
gradlew
vendored
9
gradlew
vendored
@ -86,8 +86,7 @@ done
|
|||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||||
' "$PWD" ) || exit
|
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
@ -115,7 +114,7 @@ case "$( uname )" in #(
|
|||||||
NONSTOP* ) nonstop=true ;;
|
NONSTOP* ) nonstop=true ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
CLASSPATH="\\\"\\\""
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
@ -206,7 +205,7 @@ fi
|
|||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command:
|
# Collect all arguments for the java command:
|
||||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
# and any embedded shellness will be escaped.
|
# and any embedded shellness will be escaped.
|
||||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
# treated as '${Hostname}' itself on the command line.
|
# treated as '${Hostname}' itself on the command line.
|
||||||
@ -214,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
-classpath "$CLASSPATH" \
|
-classpath "$CLASSPATH" \
|
||||||
org.gradle.wrapper.GradleWrapperMain \
|
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
# Stop when "xargs" is not available.
|
# Stop when "xargs" is not available.
|
||||||
|
4
gradlew.bat
vendored
4
gradlew.bat
vendored
@ -70,11 +70,11 @@ goto fail
|
|||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
set CLASSPATH=
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
plugins {
|
plugins {
|
||||||
application
|
application
|
||||||
id("gay.pizza.pork.module")
|
id("gay.pizza.pork.module")
|
||||||
id("com.github.johnrengelman.shadow") version "8.1.1"
|
id("com.gradleup.shadow") version "8.3.8"
|
||||||
id("org.graalvm.buildtools.native") version "0.9.25"
|
id("org.graalvm.buildtools.native") version "0.10.6"
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import gay.pizza.pork.buildext.AstCodegenType
|
import gay.pizza.pork.buildext.AstCodegenType
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("org.jetbrains.intellij.platform") version "2.3.0"
|
id("org.jetbrains.intellij.platform") version "2.6.0"
|
||||||
id("gay.pizza.pork.module")
|
id("gay.pizza.pork.module")
|
||||||
id("gay.pizza.pork.ast")
|
id("gay.pizza.pork.ast")
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
plugins {
|
plugins {
|
||||||
application
|
application
|
||||||
id("gay.pizza.pork.module")
|
id("gay.pizza.pork.module")
|
||||||
id("com.github.johnrengelman.shadow") version "8.1.1"
|
id("com.gradleup.shadow") version "8.3.8"
|
||||||
id("org.graalvm.buildtools.native") version "0.9.25"
|
id("org.graalvm.buildtools.native") version "0.10.6"
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api(project(":minimal"))
|
api(project(":minimal"))
|
||||||
api(project(":compiler"))
|
api(project(":compiler"))
|
||||||
api(project(":vm"))
|
api(project(":vm"))
|
||||||
api("com.github.ajalt.clikt:clikt:4.2.0")
|
api("com.github.ajalt.clikt:clikt:5.0.3")
|
||||||
api("com.charleskorn.kaml:kaml:0.55.0")
|
api("com.charleskorn.kaml:kaml:0.83.0")
|
||||||
|
|
||||||
implementation(project(":common"))
|
implementation(project(":common"))
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package gay.pizza.pork.tool
|
package gay.pizza.pork.tool
|
||||||
|
|
||||||
import com.github.ajalt.clikt.core.CliktCommand
|
import com.github.ajalt.clikt.core.CliktCommand
|
||||||
|
import com.github.ajalt.clikt.core.Context
|
||||||
import com.github.ajalt.clikt.parameters.arguments.argument
|
import com.github.ajalt.clikt.parameters.arguments.argument
|
||||||
import gay.pizza.dough.fs.PlatformFsProvider
|
import gay.pizza.dough.fs.PlatformFsProvider
|
||||||
import gay.pizza.pork.ast.gen.Node
|
import gay.pizza.pork.ast.gen.Node
|
||||||
@ -9,13 +10,15 @@ import kotlinx.serialization.ExperimentalSerializationApi
|
|||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
|
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
@OptIn(ExperimentalSerializationApi::class)
|
||||||
class AstCommand : CliktCommand(help = "Print AST", name = "ast") {
|
class AstCommand : CliktCommand("ast") {
|
||||||
val path by argument("file")
|
val path by argument("file")
|
||||||
|
|
||||||
|
override fun help(context: Context): String = "Print AST"
|
||||||
|
|
||||||
private val json = Json {
|
private val json = Json {
|
||||||
prettyPrint = true
|
prettyPrint = true
|
||||||
prettyPrintIndent = " "
|
prettyPrintIndent = " "
|
||||||
classDiscriminator = "\$"
|
classDiscriminator = "$"
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun run() {
|
override fun run() {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package gay.pizza.pork.tool
|
package gay.pizza.pork.tool
|
||||||
|
|
||||||
import com.github.ajalt.clikt.core.CliktCommand
|
import com.github.ajalt.clikt.core.CliktCommand
|
||||||
|
import com.github.ajalt.clikt.core.Context
|
||||||
import com.github.ajalt.clikt.parameters.arguments.argument
|
import com.github.ajalt.clikt.parameters.arguments.argument
|
||||||
import com.github.ajalt.clikt.parameters.options.flag
|
import com.github.ajalt.clikt.parameters.options.flag
|
||||||
import com.github.ajalt.clikt.parameters.options.option
|
import com.github.ajalt.clikt.parameters.options.option
|
||||||
@ -13,10 +14,12 @@ import gay.pizza.pork.minimal.FileTool
|
|||||||
import gay.pizza.pork.parser.ParserAttributes
|
import gay.pizza.pork.parser.ParserAttributes
|
||||||
import gay.pizza.pork.parser.ParserNodeAttribution
|
import gay.pizza.pork.parser.ParserNodeAttribution
|
||||||
|
|
||||||
class AttributeCommand : CliktCommand(help = "Attribute AST", name = "attribute") {
|
class AttributeCommand : CliktCommand("attribute") {
|
||||||
val hierarchical by option("--hierarchical", help = "Print Hierarchical Output").flag(default = true)
|
val hierarchical by option("--hierarchical", help = "Print Hierarchical Output").flag(default = true)
|
||||||
val path by argument("file")
|
val path by argument("file")
|
||||||
|
|
||||||
|
override fun help(context: Context): String = "Attribute AST"
|
||||||
|
|
||||||
override fun run() {
|
override fun run() {
|
||||||
val tool = FileTool(PlatformFsProvider.resolve(path))
|
val tool = FileTool(PlatformFsProvider.resolve(path))
|
||||||
val attribution = ParserNodeAttribution()
|
val attribution = ParserNodeAttribution()
|
||||||
|
@ -3,6 +3,7 @@ package gay.pizza.pork.tool
|
|||||||
import com.charleskorn.kaml.PolymorphismStyle
|
import com.charleskorn.kaml.PolymorphismStyle
|
||||||
import com.charleskorn.kaml.Yaml
|
import com.charleskorn.kaml.Yaml
|
||||||
import com.github.ajalt.clikt.core.CliktCommand
|
import com.github.ajalt.clikt.core.CliktCommand
|
||||||
|
import com.github.ajalt.clikt.core.Context
|
||||||
import com.github.ajalt.clikt.parameters.arguments.argument
|
import com.github.ajalt.clikt.parameters.arguments.argument
|
||||||
import com.github.ajalt.clikt.parameters.options.flag
|
import com.github.ajalt.clikt.parameters.options.flag
|
||||||
import com.github.ajalt.clikt.parameters.options.option
|
import com.github.ajalt.clikt.parameters.options.option
|
||||||
@ -16,12 +17,14 @@ import gay.pizza.pork.bytecode.Opcode
|
|||||||
import gay.pizza.pork.compiler.Compiler
|
import gay.pizza.pork.compiler.Compiler
|
||||||
import gay.pizza.pork.minimal.FileTool
|
import gay.pizza.pork.minimal.FileTool
|
||||||
|
|
||||||
class CompileCommand : CliktCommand(help = "Compile Pork", name = "compile") {
|
class CompileCommand : CliktCommand("compile") {
|
||||||
val showIrCode by option("--show-ir-code").flag(default = false)
|
val showIrCode by option("--show-ir-code").flag(default = false)
|
||||||
val showIrSymbolGraph by option("--show-ir-symbol-graph").flag(default = false)
|
val showIrSymbolGraph by option("--show-ir-symbol-graph").flag(default = false)
|
||||||
|
|
||||||
val path by argument("file")
|
val path by argument("file")
|
||||||
|
|
||||||
|
override fun help(context: Context): String = "Compile Pork"
|
||||||
|
|
||||||
private val yaml = Yaml(
|
private val yaml = Yaml(
|
||||||
configuration = Yaml.default.configuration.copy(
|
configuration = Yaml.default.configuration.copy(
|
||||||
polymorphismStyle = PolymorphismStyle.Property
|
polymorphismStyle = PolymorphismStyle.Property
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package gay.pizza.pork.tool
|
package gay.pizza.pork.tool
|
||||||
|
|
||||||
import com.github.ajalt.clikt.core.CliktCommand
|
import com.github.ajalt.clikt.core.CliktCommand
|
||||||
|
import com.github.ajalt.clikt.core.Context
|
||||||
import com.github.ajalt.clikt.parameters.arguments.argument
|
import com.github.ajalt.clikt.parameters.arguments.argument
|
||||||
import com.github.ajalt.clikt.parameters.arguments.default
|
import com.github.ajalt.clikt.parameters.arguments.default
|
||||||
import gay.pizza.dough.fs.PlatformFsProvider
|
import gay.pizza.dough.fs.PlatformFsProvider
|
||||||
@ -10,9 +11,11 @@ import gay.pizza.dough.fs.writeString
|
|||||||
import gay.pizza.pork.tokenizer.readToString
|
import gay.pizza.pork.tokenizer.readToString
|
||||||
import gay.pizza.pork.stdlib.PorkStdlib
|
import gay.pizza.pork.stdlib.PorkStdlib
|
||||||
|
|
||||||
class CopyStdlibCommand : CliktCommand(help = "Copy Stdlib", name = "copy-stdlib") {
|
class CopyStdlibCommand : CliktCommand("copy-stdlib") {
|
||||||
val output by argument("output").default("stdlib")
|
val output by argument("output").default("stdlib")
|
||||||
|
|
||||||
|
override fun help(context: Context): String = "Copy Stdlib"
|
||||||
|
|
||||||
override fun run() {
|
override fun run() {
|
||||||
val outputFsPath = PlatformFsProvider.resolve(output)
|
val outputFsPath = PlatformFsProvider.resolve(output)
|
||||||
for (filePath in PorkStdlib.files) {
|
for (filePath in PorkStdlib.files) {
|
||||||
|
@ -1,14 +1,17 @@
|
|||||||
package gay.pizza.pork.tool
|
package gay.pizza.pork.tool
|
||||||
|
|
||||||
import com.github.ajalt.clikt.core.CliktCommand
|
import com.github.ajalt.clikt.core.CliktCommand
|
||||||
|
import com.github.ajalt.clikt.core.Context
|
||||||
import com.github.ajalt.clikt.parameters.arguments.argument
|
import com.github.ajalt.clikt.parameters.arguments.argument
|
||||||
import gay.pizza.dough.fs.PlatformFsProvider
|
import gay.pizza.dough.fs.PlatformFsProvider
|
||||||
import gay.pizza.pork.minimal.FileTool
|
import gay.pizza.pork.minimal.FileTool
|
||||||
import gay.pizza.pork.tokenizer.AnsiHighlightScheme
|
import gay.pizza.pork.tokenizer.AnsiHighlightScheme
|
||||||
|
|
||||||
class HighlightCommand : CliktCommand(help = "Syntax Highlighter", name = "highlight") {
|
class HighlightCommand : CliktCommand("highlight") {
|
||||||
val path by argument("file")
|
val path by argument("file")
|
||||||
|
|
||||||
|
override fun help(context: Context): String = "Syntax Highlighter"
|
||||||
|
|
||||||
override fun run() {
|
override fun run() {
|
||||||
val tool = FileTool(PlatformFsProvider.resolve(path))
|
val tool = FileTool(PlatformFsProvider.resolve(path))
|
||||||
print(tool.highlight(AnsiHighlightScheme()).joinToString(""))
|
print(tool.highlight(AnsiHighlightScheme()).joinToString(""))
|
||||||
|
@ -1,17 +1,20 @@
|
|||||||
package gay.pizza.pork.tool
|
package gay.pizza.pork.tool
|
||||||
|
|
||||||
import com.github.ajalt.clikt.core.CliktCommand
|
import com.github.ajalt.clikt.core.CliktCommand
|
||||||
|
import com.github.ajalt.clikt.core.Context
|
||||||
import com.github.ajalt.clikt.parameters.arguments.argument
|
import com.github.ajalt.clikt.parameters.arguments.argument
|
||||||
import com.github.ajalt.clikt.parameters.options.flag
|
import com.github.ajalt.clikt.parameters.options.flag
|
||||||
import com.github.ajalt.clikt.parameters.options.option
|
import com.github.ajalt.clikt.parameters.options.option
|
||||||
import gay.pizza.dough.fs.PlatformFsProvider
|
import gay.pizza.dough.fs.PlatformFsProvider
|
||||||
import gay.pizza.pork.minimal.FileTool
|
import gay.pizza.pork.minimal.FileTool
|
||||||
|
|
||||||
class ParseCommand : CliktCommand(help = "Parse Compilation Unit", name = "parse") {
|
class ParseCommand : CliktCommand("parse") {
|
||||||
val loop by option("--loop", help = "Loop Parsing").flag()
|
val loop by option("--loop", help = "Loop Parsing").flag()
|
||||||
val measure by option("--measure", help = "Measure Time").flag()
|
val measure by option("--measure", help = "Measure Time").flag()
|
||||||
val path by argument("file")
|
val path by argument("file")
|
||||||
|
|
||||||
|
override fun help(context: Context): String = "Parse Compilation Unit"
|
||||||
|
|
||||||
override fun run() {
|
override fun run() {
|
||||||
val tool = FileTool(PlatformFsProvider.resolve(path))
|
val tool = FileTool(PlatformFsProvider.resolve(path))
|
||||||
|
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
package gay.pizza.pork.tool
|
package gay.pizza.pork.tool
|
||||||
|
|
||||||
import com.github.ajalt.clikt.core.CliktCommand
|
import com.github.ajalt.clikt.core.CliktCommand
|
||||||
|
import com.github.ajalt.clikt.core.Context
|
||||||
import com.github.ajalt.clikt.parameters.arguments.argument
|
import com.github.ajalt.clikt.parameters.arguments.argument
|
||||||
import gay.pizza.dough.fs.PlatformFsProvider
|
import gay.pizza.dough.fs.PlatformFsProvider
|
||||||
import gay.pizza.pork.minimal.FileTool
|
import gay.pizza.pork.minimal.FileTool
|
||||||
|
|
||||||
class ReprintCommand : CliktCommand(help = "Reprint Parsed Compilation Unit", name = "reprint") {
|
class ReprintCommand : CliktCommand("reprint") {
|
||||||
val path by argument("file")
|
val path by argument("file")
|
||||||
|
|
||||||
|
override fun help(context: Context): String = "Reprint Parsed Compilation Unit"
|
||||||
|
|
||||||
override fun run() {
|
override fun run() {
|
||||||
val tool = FileTool(PlatformFsProvider.resolve(path))
|
val tool = FileTool(PlatformFsProvider.resolve(path))
|
||||||
print(tool.reprint())
|
print(tool.reprint())
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
package gay.pizza.pork.tool
|
package gay.pizza.pork.tool
|
||||||
|
|
||||||
import com.github.ajalt.clikt.core.CliktCommand
|
import com.github.ajalt.clikt.core.CliktCommand
|
||||||
|
import com.github.ajalt.clikt.core.Context
|
||||||
import com.github.ajalt.clikt.core.subcommands
|
import com.github.ajalt.clikt.core.subcommands
|
||||||
|
|
||||||
class RootCommand : CliktCommand(
|
class RootCommand : CliktCommand("pork") {
|
||||||
help = "Pork - The BBQ Language",
|
|
||||||
name = "pork"
|
|
||||||
) {
|
|
||||||
init {
|
init {
|
||||||
subcommands(
|
subcommands(
|
||||||
RunCommand(),
|
RunCommand(),
|
||||||
@ -22,5 +20,7 @@ class RootCommand : CliktCommand(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun help(context: Context): String = "Pork - The BBQ Language"
|
||||||
|
|
||||||
override fun run() {}
|
override fun run() {}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package gay.pizza.pork.tool
|
package gay.pizza.pork.tool
|
||||||
|
|
||||||
import com.github.ajalt.clikt.core.CliktCommand
|
import com.github.ajalt.clikt.core.CliktCommand
|
||||||
|
import com.github.ajalt.clikt.core.Context
|
||||||
import com.github.ajalt.clikt.parameters.arguments.argument
|
import com.github.ajalt.clikt.parameters.arguments.argument
|
||||||
import com.github.ajalt.clikt.parameters.options.default
|
import com.github.ajalt.clikt.parameters.options.default
|
||||||
import com.github.ajalt.clikt.parameters.options.flag
|
import com.github.ajalt.clikt.parameters.options.flag
|
||||||
@ -15,7 +16,7 @@ import gay.pizza.pork.ffi.JavaNativeProvider
|
|||||||
import gay.pizza.pork.minimal.ExecutionType
|
import gay.pizza.pork.minimal.ExecutionType
|
||||||
import gay.pizza.pork.minimal.FileTool
|
import gay.pizza.pork.minimal.FileTool
|
||||||
|
|
||||||
class RunCommand : CliktCommand(help = "Run Program", name = "run") {
|
class RunCommand : CliktCommand("run") {
|
||||||
val loop by option("--loop", help = "Loop Program").flag()
|
val loop by option("--loop", help = "Loop Program").flag()
|
||||||
val measure by option("--measure", help = "Measure Time").flag()
|
val measure by option("--measure", help = "Measure Time").flag()
|
||||||
val quiet by option("--quiet", help = "Silence Prints").flag()
|
val quiet by option("--quiet", help = "Silence Prints").flag()
|
||||||
@ -24,6 +25,8 @@ class RunCommand : CliktCommand(help = "Run Program", name = "run") {
|
|||||||
.default(ExecutionType.VirtualMachine)
|
.default(ExecutionType.VirtualMachine)
|
||||||
val path by argument("file")
|
val path by argument("file")
|
||||||
|
|
||||||
|
override fun help(context: Context): String = "Run Program"
|
||||||
|
|
||||||
override fun run() {
|
override fun run() {
|
||||||
val tool = FileTool(PlatformFsProvider.resolve(path))
|
val tool = FileTool(PlatformFsProvider.resolve(path))
|
||||||
val nativeRegistry = NativeRegistry()
|
val nativeRegistry = NativeRegistry()
|
||||||
|
@ -1,14 +1,17 @@
|
|||||||
package gay.pizza.pork.tool
|
package gay.pizza.pork.tool
|
||||||
|
|
||||||
import com.github.ajalt.clikt.core.CliktCommand
|
import com.github.ajalt.clikt.core.CliktCommand
|
||||||
|
import com.github.ajalt.clikt.core.Context
|
||||||
import com.github.ajalt.clikt.parameters.arguments.argument
|
import com.github.ajalt.clikt.parameters.arguments.argument
|
||||||
import gay.pizza.dough.fs.PlatformFsProvider
|
import gay.pizza.dough.fs.PlatformFsProvider
|
||||||
import gay.pizza.pork.frontend.scope.WorldScope
|
import gay.pizza.pork.frontend.scope.WorldScope
|
||||||
import gay.pizza.pork.minimal.FileTool
|
import gay.pizza.pork.minimal.FileTool
|
||||||
|
|
||||||
class ScopeAnalysisCommand : CliktCommand(help = "Run Scope Analysis", name = "scope-analysis") {
|
class ScopeAnalysisCommand : CliktCommand("scope-analysis") {
|
||||||
val path by argument("file")
|
val path by argument("file")
|
||||||
|
|
||||||
|
override fun help(context: Context): String = "Run Scope Analysis"
|
||||||
|
|
||||||
override fun run() {
|
override fun run() {
|
||||||
val tool = FileTool(PlatformFsProvider.resolve(path))
|
val tool = FileTool(PlatformFsProvider.resolve(path))
|
||||||
val world = tool.buildWorld()
|
val world = tool.buildWorld()
|
||||||
|
@ -1,14 +1,17 @@
|
|||||||
package gay.pizza.pork.tool
|
package gay.pizza.pork.tool
|
||||||
|
|
||||||
import com.github.ajalt.clikt.core.CliktCommand
|
import com.github.ajalt.clikt.core.CliktCommand
|
||||||
|
import com.github.ajalt.clikt.core.Context
|
||||||
import com.github.ajalt.clikt.parameters.arguments.argument
|
import com.github.ajalt.clikt.parameters.arguments.argument
|
||||||
import gay.pizza.dough.fs.PlatformFsProvider
|
import gay.pizza.dough.fs.PlatformFsProvider
|
||||||
import gay.pizza.pork.minimal.FileTool
|
import gay.pizza.pork.minimal.FileTool
|
||||||
import gay.pizza.pork.tokenizer.TokenType
|
import gay.pizza.pork.tokenizer.TokenType
|
||||||
|
|
||||||
class TokenizeCommand : CliktCommand(help = "Tokenize Compilation Unit", name = "tokenize") {
|
class TokenizeCommand : CliktCommand("tokenize") {
|
||||||
val path by argument("file")
|
val path by argument("file")
|
||||||
|
|
||||||
|
override fun help(context: Context): String = "Tokenize Compilation Unit"
|
||||||
|
|
||||||
override fun run() {
|
override fun run() {
|
||||||
val tool = FileTool(PlatformFsProvider.resolve(path))
|
val tool = FileTool(PlatformFsProvider.resolve(path))
|
||||||
val tokenSource = tool.tokenize()
|
val tokenSource = tool.tokenize()
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
package gay.pizza.pork.tool
|
package gay.pizza.pork.tool
|
||||||
|
|
||||||
|
import com.github.ajalt.clikt.core.main
|
||||||
|
|
||||||
fun main(args: Array<String>) = RootCommand().main(args)
|
fun main(args: Array<String>) = RootCommand().main(args)
|
||||||
|
Loading…
Reference in New Issue
Block a user