added _main
This commit is contained in:
+5
-1
@@ -460,5 +460,9 @@ func RunFile(filePath string, libCode string) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil { fmt.Fprintf(os.Stderr, "Error executing %s: %v\n", filePath, r); os.Exit(1) }
|
||||
}()
|
||||
NewClyx("", libCode).Run(string(content))
|
||||
c := NewClyx("", libCode)
|
||||
c.Run(string(content))
|
||||
if c.HasWord("_main") {
|
||||
c.Run("_main")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user