This commit is contained in:
2026-01-27 16:20:46 -05:00
parent 7bf4f115b1
commit c3a16c9e92
21 changed files with 1192 additions and 577 deletions

33
cmd/poiesis/main.go Normal file
View File

@@ -0,0 +1,33 @@
package main
import (
"fmt"
"os"
"reichard.io/poiesis/internal/builtin"
"reichard.io/poiesis/internal/runtime"
_ "reichard.io/poiesis/internal/standard"
)
func main() {
if len(os.Args) < 2 {
fmt.Fprintln(os.Stderr, "Usage: poiesis <typescript-file>")
fmt.Fprintln(os.Stderr, " poiesis -print-types")
os.Exit(1)
}
// Print Types
if os.Args[1] == "-print-types" {
fmt.Println(builtin.GetBuiltinsDeclarations())
return
}
// Get File
filePath := os.Args[1]
// Run File
rt := runtime.New()
if err := rt.RunFile(filePath, os.Stdout, os.Stderr); err != nil {
os.Exit(1)
}
}