// Parse given raw amber template string. func (c *Compiler) Parse(input string) (err error) { defer func() { if r := recover(); r != nil { err = errors.New(r.(string)) } }() parser, err := parser.StringParser(input) if err != nil { return } c.node = parser.Parse() return }
// Parse the amber template file in given path func (c *Compiler) ParseFile(filename string) (err error) { defer func() { if r := recover(); r != nil { err = errors.New(r.(string)) } }() parser, err := parser.FileParser(filename) if err != nil { return } c.node = parser.Parse() c.filename = filename return }