mirror of
https://github.com/Open-Argon/argon-v3.git
synced 2025-12-06 08:56:07 +00:00
70 lines
1.4 KiB
Go
70 lines
1.4 KiB
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
// args without the program path
|
|
var Args = os.Args[1:]
|
|
|
|
type stack = []ArObject
|
|
|
|
const VERSION = "3.1.0 oop numbers beta 1"
|
|
const VERSION_NUM = 7
|
|
|
|
func newscope() ArObject {
|
|
return Map(anymap{})
|
|
}
|
|
|
|
func main() {
|
|
debugInit()
|
|
|
|
if !debug {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
fmt.Println("There was a fundamental error in argon v" + VERSION + " that caused it to crash.")
|
|
fmt.Println()
|
|
fmt.Println("website:", website)
|
|
fmt.Println("docs:", docs)
|
|
fmt.Println()
|
|
if fork {
|
|
fmt.Println("This is a fork of Open-Argon. Please report this to the fork's maintainer.")
|
|
fmt.Println("Fork repo:", forkrepo)
|
|
fmt.Println("Fork issue page:", forkissuesPage)
|
|
fmt.Println()
|
|
} else {
|
|
fmt.Println("Please report this to the Open-Argon team.")
|
|
fmt.Println("Main repo:", mainrepo)
|
|
fmt.Println("Issue page:", mainissuesPage)
|
|
fmt.Println()
|
|
}
|
|
fmt.Println("please include the following information:")
|
|
fmt.Println("panic:", r)
|
|
os.Exit(1)
|
|
}
|
|
}()
|
|
}
|
|
garbageCollect()
|
|
global := makeGlobal()
|
|
if len(Args) == 0 {
|
|
shell(global)
|
|
os.Exit(0)
|
|
}
|
|
ex, e := os.Getwd()
|
|
if e != nil {
|
|
panic(e)
|
|
}
|
|
translated, err := translateImport(Args[0], ex, true)
|
|
if err.EXISTS {
|
|
panicErr(err)
|
|
os.Exit(1)
|
|
}
|
|
_, runimeErr := runTranslatedImport(translated, global, true)
|
|
if runimeErr.EXISTS {
|
|
panicErr(runimeErr)
|
|
os.Exit(1)
|
|
}
|
|
threadChan.Wait()
|
|
}
|