-
Notifications
You must be signed in to change notification settings - Fork 1
/
ast.go
29 lines (25 loc) · 916 Bytes
/
ast.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package twik
import (
"github.com/drtoful/gifttt/Godeps/_workspace/src/github.com/drtoful/twik/ast"
)
// NewFileSet returns a new FileSet to hold positioning information
// for a set of parsed twik sources.
func NewFileSet() *ast.FileSet {
return ast.NewFileSet()
}
// Parse parses a byte slice containing twik code and returns
// the resulting parsed tree.
//
// Positioning information for the parsed code will be stored in
// fset under the given name.
func Parse(fset *ast.FileSet, name string, code []byte) (ast.Node, error) {
return ast.ParseString(fset, name, string(code))
}
// ParseString parses a string containing twik code and returns
// the resulting parsed tree.
//
// Positioning information for the parsed code will be stored in
// fset under the given name.
func ParseString(fset *ast.FileSet, name string, code string) (ast.Node, error) {
return ast.ParseString(fset, name, string(code))
}