asd
This commit is contained in:
33
cmd/poiesis/main.go
Normal file
33
cmd/poiesis/main.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user