mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2025-08-03 13:11:32 +00:00
upgrade dependencies
This commit is contained in:
@ -1,16 +1,16 @@
|
||||
plugins {
|
||||
application
|
||||
id("gay.pizza.pork.module")
|
||||
id("com.github.johnrengelman.shadow") version "8.1.1"
|
||||
id("org.graalvm.buildtools.native") version "0.9.25"
|
||||
id("com.gradleup.shadow") version "8.3.8"
|
||||
id("org.graalvm.buildtools.native") version "0.10.6"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(project(":minimal"))
|
||||
api(project(":compiler"))
|
||||
api(project(":vm"))
|
||||
api("com.github.ajalt.clikt:clikt:4.2.0")
|
||||
api("com.charleskorn.kaml:kaml:0.55.0")
|
||||
api("com.github.ajalt.clikt:clikt:5.0.3")
|
||||
api("com.charleskorn.kaml:kaml:0.83.0")
|
||||
|
||||
implementation(project(":common"))
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package gay.pizza.pork.tool
|
||||
|
||||
import com.github.ajalt.clikt.core.CliktCommand
|
||||
import com.github.ajalt.clikt.core.Context
|
||||
import com.github.ajalt.clikt.parameters.arguments.argument
|
||||
import gay.pizza.dough.fs.PlatformFsProvider
|
||||
import gay.pizza.pork.ast.gen.Node
|
||||
@ -9,13 +10,15 @@ import kotlinx.serialization.ExperimentalSerializationApi
|
||||
import kotlinx.serialization.json.Json
|
||||
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
class AstCommand : CliktCommand(help = "Print AST", name = "ast") {
|
||||
class AstCommand : CliktCommand("ast") {
|
||||
val path by argument("file")
|
||||
|
||||
override fun help(context: Context): String = "Print AST"
|
||||
|
||||
private val json = Json {
|
||||
prettyPrint = true
|
||||
prettyPrintIndent = " "
|
||||
classDiscriminator = "\$"
|
||||
classDiscriminator = "$"
|
||||
}
|
||||
|
||||
override fun run() {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package gay.pizza.pork.tool
|
||||
|
||||
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.options.flag
|
||||
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.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 path by argument("file")
|
||||
|
||||
override fun help(context: Context): String = "Attribute AST"
|
||||
|
||||
override fun run() {
|
||||
val tool = FileTool(PlatformFsProvider.resolve(path))
|
||||
val attribution = ParserNodeAttribution()
|
||||
|
@ -3,6 +3,7 @@ package gay.pizza.pork.tool
|
||||
import com.charleskorn.kaml.PolymorphismStyle
|
||||
import com.charleskorn.kaml.Yaml
|
||||
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.options.flag
|
||||
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.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 showIrSymbolGraph by option("--show-ir-symbol-graph").flag(default = false)
|
||||
|
||||
val path by argument("file")
|
||||
|
||||
override fun help(context: Context): String = "Compile Pork"
|
||||
|
||||
private val yaml = Yaml(
|
||||
configuration = Yaml.default.configuration.copy(
|
||||
polymorphismStyle = PolymorphismStyle.Property
|
||||
|
@ -1,6 +1,7 @@
|
||||
package gay.pizza.pork.tool
|
||||
|
||||
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.default
|
||||
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.stdlib.PorkStdlib
|
||||
|
||||
class CopyStdlibCommand : CliktCommand(help = "Copy Stdlib", name = "copy-stdlib") {
|
||||
class CopyStdlibCommand : CliktCommand("copy-stdlib") {
|
||||
val output by argument("output").default("stdlib")
|
||||
|
||||
override fun help(context: Context): String = "Copy Stdlib"
|
||||
|
||||
override fun run() {
|
||||
val outputFsPath = PlatformFsProvider.resolve(output)
|
||||
for (filePath in PorkStdlib.files) {
|
||||
|
@ -1,14 +1,17 @@
|
||||
package gay.pizza.pork.tool
|
||||
|
||||
import com.github.ajalt.clikt.core.CliktCommand
|
||||
import com.github.ajalt.clikt.core.Context
|
||||
import com.github.ajalt.clikt.parameters.arguments.argument
|
||||
import gay.pizza.dough.fs.PlatformFsProvider
|
||||
import gay.pizza.pork.minimal.FileTool
|
||||
import gay.pizza.pork.tokenizer.AnsiHighlightScheme
|
||||
|
||||
class HighlightCommand : CliktCommand(help = "Syntax Highlighter", name = "highlight") {
|
||||
class HighlightCommand : CliktCommand("highlight") {
|
||||
val path by argument("file")
|
||||
|
||||
override fun help(context: Context): String = "Syntax Highlighter"
|
||||
|
||||
override fun run() {
|
||||
val tool = FileTool(PlatformFsProvider.resolve(path))
|
||||
print(tool.highlight(AnsiHighlightScheme()).joinToString(""))
|
||||
|
@ -1,17 +1,20 @@
|
||||
package gay.pizza.pork.tool
|
||||
|
||||
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.options.flag
|
||||
import com.github.ajalt.clikt.parameters.options.option
|
||||
import gay.pizza.dough.fs.PlatformFsProvider
|
||||
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 measure by option("--measure", help = "Measure Time").flag()
|
||||
val path by argument("file")
|
||||
|
||||
override fun help(context: Context): String = "Parse Compilation Unit"
|
||||
|
||||
override fun run() {
|
||||
val tool = FileTool(PlatformFsProvider.resolve(path))
|
||||
|
||||
|
@ -1,13 +1,16 @@
|
||||
package gay.pizza.pork.tool
|
||||
|
||||
import com.github.ajalt.clikt.core.CliktCommand
|
||||
import com.github.ajalt.clikt.core.Context
|
||||
import com.github.ajalt.clikt.parameters.arguments.argument
|
||||
import gay.pizza.dough.fs.PlatformFsProvider
|
||||
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")
|
||||
|
||||
override fun help(context: Context): String = "Reprint Parsed Compilation Unit"
|
||||
|
||||
override fun run() {
|
||||
val tool = FileTool(PlatformFsProvider.resolve(path))
|
||||
print(tool.reprint())
|
||||
|
@ -1,12 +1,10 @@
|
||||
package gay.pizza.pork.tool
|
||||
|
||||
import com.github.ajalt.clikt.core.CliktCommand
|
||||
import com.github.ajalt.clikt.core.Context
|
||||
import com.github.ajalt.clikt.core.subcommands
|
||||
|
||||
class RootCommand : CliktCommand(
|
||||
help = "Pork - The BBQ Language",
|
||||
name = "pork"
|
||||
) {
|
||||
class RootCommand : CliktCommand("pork") {
|
||||
init {
|
||||
subcommands(
|
||||
RunCommand(),
|
||||
@ -22,5 +20,7 @@ class RootCommand : CliktCommand(
|
||||
)
|
||||
}
|
||||
|
||||
override fun help(context: Context): String = "Pork - The BBQ Language"
|
||||
|
||||
override fun run() {}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package gay.pizza.pork.tool
|
||||
|
||||
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.options.default
|
||||
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.FileTool
|
||||
|
||||
class RunCommand : CliktCommand(help = "Run Program", name = "run") {
|
||||
class RunCommand : CliktCommand("run") {
|
||||
val loop by option("--loop", help = "Loop Program").flag()
|
||||
val measure by option("--measure", help = "Measure Time").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)
|
||||
val path by argument("file")
|
||||
|
||||
override fun help(context: Context): String = "Run Program"
|
||||
|
||||
override fun run() {
|
||||
val tool = FileTool(PlatformFsProvider.resolve(path))
|
||||
val nativeRegistry = NativeRegistry()
|
||||
|
@ -1,14 +1,17 @@
|
||||
package gay.pizza.pork.tool
|
||||
|
||||
import com.github.ajalt.clikt.core.CliktCommand
|
||||
import com.github.ajalt.clikt.core.Context
|
||||
import com.github.ajalt.clikt.parameters.arguments.argument
|
||||
import gay.pizza.dough.fs.PlatformFsProvider
|
||||
import gay.pizza.pork.frontend.scope.WorldScope
|
||||
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")
|
||||
|
||||
override fun help(context: Context): String = "Run Scope Analysis"
|
||||
|
||||
override fun run() {
|
||||
val tool = FileTool(PlatformFsProvider.resolve(path))
|
||||
val world = tool.buildWorld()
|
||||
|
@ -1,14 +1,17 @@
|
||||
package gay.pizza.pork.tool
|
||||
|
||||
import com.github.ajalt.clikt.core.CliktCommand
|
||||
import com.github.ajalt.clikt.core.Context
|
||||
import com.github.ajalt.clikt.parameters.arguments.argument
|
||||
import gay.pizza.dough.fs.PlatformFsProvider
|
||||
import gay.pizza.pork.minimal.FileTool
|
||||
import gay.pizza.pork.tokenizer.TokenType
|
||||
|
||||
class TokenizeCommand : CliktCommand(help = "Tokenize Compilation Unit", name = "tokenize") {
|
||||
class TokenizeCommand : CliktCommand("tokenize") {
|
||||
val path by argument("file")
|
||||
|
||||
override fun help(context: Context): String = "Tokenize Compilation Unit"
|
||||
|
||||
override fun run() {
|
||||
val tool = FileTool(PlatformFsProvider.resolve(path))
|
||||
val tokenSource = tool.tokenize()
|
||||
|
@ -1,3 +1,5 @@
|
||||
package gay.pizza.pork.tool
|
||||
|
||||
import com.github.ajalt.clikt.core.main
|
||||
|
||||
fun main(args: Array<String>) = RootCommand().main(args)
|
||||
|
Reference in New Issue
Block a user