Started loading type information.

This commit is contained in:
Marvin Blum
2015-12-17 22:49:56 +01:00
parent ed1d19851e
commit 05e6937201
3 changed files with 2263 additions and 15 deletions

32
src/types/loader.go Normal file
View File

@@ -0,0 +1,32 @@
package types
import (
"fmt"
"io/ioutil"
"strings"
)
// Loads type information from file.
func LoadTypes(path string) error {
content, err := ioutil.ReadFile(path)
if err != nil {
return err
}
if err := parseTypes(string(content)); err != nil {
return err
}
return nil
}
func parseTypes(content string) error {
lines := strings.Split(content, "\\n")
for _, line := range lines {
fmt.Println(line)
}
return nil
}