mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 00:55:11 +01:00
Add pkg to ast Func, Struct and TypeExpr nodes
This commit is contained in:
1 parent
10e4936f08
commit
ed03c5943a
16 files changed
+311
-245
No files matched your search
+3
-3
@@ -267,11 +267,11 @@ func (h *genHelper) genWuffs(dirname string, qualifiedFilenames []string) error
|
||||
} else if n.Impure() {
|
||||
effect = "!"
|
||||
}
|
||||
if n.Receiver() == 0 {
|
||||
if n.Receiver().IsZero() {
|
||||
return fmt.Errorf("TODO: genWuffs for a free-standing function")
|
||||
}
|
||||
// TODO: look at n.Asserts().
|
||||
fmt.Fprintf(out, "pub func %s.%s%s(", n.Receiver().Str(&h.tm), n.Name().Str(&h.tm), effect)
|
||||
fmt.Fprintf(out, "pub func %s.%s%s(", n.Receiver().Str(&h.tm), n.FuncName().Str(&h.tm), effect)
|
||||
for i, param := range [2]*a.Struct{n.In(), n.Out()} {
|
||||
if i > 0 {
|
||||
fmt.Fprintf(out, ")(")
|
||||
@@ -304,7 +304,7 @@ func (h *genHelper) genWuffs(dirname string, qualifiedFilenames []string) error
|
||||
if n.Suspendible() {
|
||||
effect = "?"
|
||||
}
|
||||
fmt.Fprintf(out, "pub struct %s%s()\n", n.Name().Str(&h.tm), effect)
|
||||
fmt.Fprintf(out, "pub struct %s%s()\n", n.QID().Str(&h.tm), effect)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user