func NewGenerator(files map[*ast.File]string) *Generator {
	interpreter := interp.NewInterpreter(data.RT)
	thread := interpreter.NewThread(nil)
	var packageName string
	var packagePath string
	for file := range files {
		packageName = file.Name.Name
		packagePath = packageName + "/"
		break
	}
	return &Generator{files, interpreter, thread, packageName, packagePath, nil}
}
Exemple #2
0
func NewGenerator(files map[*ast.File]string) *Generator {
	interpreter := interp.NewInterpreter(data.RT)
	thread := interpreter.NewThread(nil)
	var packageName string
	var packagePath string
	for file := range files {
		packageName = file.Name.Name
		packagePath = packageName + "/"
		break
	}
	astFiles := make(map[string]*ast.File)
	for file, fileNameRoot := range files {
		astFiles[fileNameRoot] = file
	}
	return &Generator{files, astFiles, interpreter, thread, packageName, packagePath, nil, nil}
}
func init() {
	interpreter = interp.NewInterpreter(RT)
}