2023-04-02 16:00:56 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
"io/ioutil"
|
|
|
|
|
2023-04-14 10:59:37 +02:00
|
|
|
"git.defalsify.org/vise/vm"
|
2023-04-02 16:00:56 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
if (len(os.Args) < 2) {
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
fp := os.Args[1]
|
|
|
|
v, err := ioutil.ReadFile(fp)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Fprintf(os.Stderr, "read error: %v", err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
r, err := vm.ToString(v)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Fprintf(os.Stderr, "parse error: %v", err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
fmt.Printf(r)
|
|
|
|
}
|