mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 08:47:28 +01:00
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:
1 parent
3a6ccbae67
commit
54567dbd47
6 files changed
+13
-13
No files matched your search
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user