zclparse: function to create a new Parser

This commit is contained in:
Martin Atkins 2017-06-04 08:40:49 -07:00
parent 1979cb4c56
commit 19064ef9ee

View File

@ -28,6 +28,13 @@ type Parser struct {
files map[string]*zcl.File
}
// NewParser creates a new parser, ready to parse configuration files.
func NewParser() *Parser {
return &Parser{
files: map[string]*zcl.File{},
}
}
// ParseZCL parses the given buffer (which is assumed to have been loaded from
// the given filename) as a native-syntax configuration file and returns the
// zcl.File object representing it.