Skip to content
Snippets Groups Projects
Commit 947a8775 authored by Aleksander Einarsen's avatar Aleksander Einarsen
Browse files

#56 Removed commented code

parent 6f0503ef
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,13 @@ type ICompiler interface {
Compile() (string, error)
}
type ILanguageEnvironment interface {
SetupEnvironment(cmdPrefix string, dependencies []string)
CheckCompileErrors(filename string, language Language, cmdPrefix string) (string, error)
WriteCodeToFile(filename, sourceCode string) error
RunPipeline(c *Compiler) (string, error)
}
type GoEnvironment struct {
}
......@@ -141,13 +148,6 @@ func getLanguageEnv(language Language) ILanguageEnvironment {
}
}
type ILanguageEnvironment interface {
SetupEnvironment(cmdPrefix string, dependencies []string)
CheckCompileErrors(filename string, language Language, cmdPrefix string) (string, error)
WriteCodeToFile(filename, sourceCode string) error
RunPipeline(c *Compiler) (string, error)
}
type RustEnvironment struct {
}
......@@ -220,6 +220,7 @@ func (re *RustEnvironment) WriteCodeToFile(_, sourceCode string) error {
}
/*
Compile compiles the source code and returns the output and an error.
The compiler pipeline
1. Set up OS and Language
2. Set up the temp folders
......@@ -227,28 +228,6 @@ The compiler pipeline
4. SetupEnvironment the code
5. Return the output and error
*/
//func (c *Compiler) Compile() (string, error) {
// // Set up temp folders
// setupTempFolders(TempOutputDir)
// defer removeTempFolders(TempOutputDir)
//
// srcCodeFilename := TempOutputDir + appendSuffix(c.Filename, c.Language)
// //compiledFilename := TempOutputDir + c.Filename
//
// // SetupEnvironment either Go or Rust environment, should be an interface method
// c.languageEnv.SetupEnvironment(c.cmdPrefix, c.Dependencies)
//
// // Write the source code to a file
// err := c.languageEnv.WriteCodeToFile(srcCodeFilename, c.SourceCode)
// if err != nil {
// log.Fatalf("Error writing source code to file: %v", err)
// }
//
// // CheckCompileErrors the code
// return c.languageEnv.CheckCompileErrors(c.Filename, c.Language, c.cmdPrefix)
//}
func (c *Compiler) Compile() (string, error) {
// Set up temp folders
setupTempFolders(TempOutputDir)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment