Add pkg to ast Const and Status nodes

This commit is contained in:
Nigel Tao committed 2017-12-28 15:14:55 +11:00
1 parent 33efa88e54
commit 10e4936f08
5 files changed
+73 -46

No files matched your search

+8 -1
View File
@@ -249,6 +249,13 @@ func (h *genHelper) genWuffs(dirname string, qualifiedFilenames []string) error
for _, f := range files {
for _, n := range f.TopLevelDecls() {
switch n.Kind() {
case a.KConst:
n := n.Const()
if !n.Public() {
continue
}
return fmt.Errorf("TODO: genWuffs for consts")
case a.KFunc:
n := n.Func()
if !n.Public() {
@@ -286,7 +293,7 @@ func (h *genHelper) genWuffs(dirname string, qualifiedFilenames []string) error
if !n.Public() {
continue
}
fmt.Fprintf(out, "pub %s %s\n", n.Keyword().Str(&h.tm), n.Message().Str(&h.tm))
fmt.Fprintf(out, "pub %s %s\n", n.Keyword().Str(&h.tm), n.QID().Str(&h.tm))
case a.KStruct:
n := n.Struct()