v0.3.3: is lib word, UTF–8 string support
This commit is contained in:
@@ -533,19 +533,3 @@ func NewClyx(libfname string, libCode string) *Clyx {
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
||||
func RunFile(filePath string, libCode string) {
|
||||
content, err := os.ReadFile(filePath)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error executing %s: %v\n", filePath, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer func() {
|
||||
if r := recover(); r != nil { fmt.Fprintf(os.Stderr, "Error executing %s: %v\n", filePath, r); os.Exit(1) }
|
||||
}()
|
||||
c := NewClyx("", libCode)
|
||||
c.Run(string(content))
|
||||
if c.HasWord("_main") {
|
||||
c.Run("_main")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user