Rename ParseFile, RenderFile to Parse, Render.

Also make various funcs' arg order consist wrt the IDMap and the input
or inputs.
This commit is contained in:
Nigel Tao committed 2017-05-11 09:48:01 +10:00
1 parent 3a6ccbae67
commit 54567dbd47
6 files changed
+13 -13

No files matched your search

+4 -4
View File
@@ -107,18 +107,18 @@ func do(r io.Reader, filename string) error {
return err
}
idMap := token.IDMap{}
tokens, comments, err := token.Tokenize(src, &idMap, filename)
idMap := &token.IDMap{}
tokens, comments, err := token.Tokenize(idMap, filename, src)
if err != nil {
return err
}
// We don't need the AST node to pretty-print, but it's worth puffsfmt
// rejecting syntax errors. This is just a parse, not a full type check.
if _, err := parse.ParseFile(tokens, &idMap, filename); err != nil {
if _, err := parse.Parse(idMap, filename, tokens); err != nil {
return err
}
buf := &bytes.Buffer{}
if err := render.RenderFile(buf, tokens, comments, &idMap); err != nil {
if err := render.Render(buf, idMap, tokens, comments); err != nil {
return err
}
dst := buf.Bytes()