Started parsing of //go:embed pragmas

This commit is contained in:
BCG
2021-07-19 20:12:44 -04:00
parent b40703e986
commit 778c79cc85
10 changed files with 116 additions and 1 deletions
+4
View File
@@ -331,6 +331,7 @@ type globalInfo struct {
extern bool // go:extern
align int // go:align
section string // go:section
embeds string // go:embed
}
// loadASTComments loads comments on globals from the AST, for use later in the
@@ -448,6 +449,9 @@ func (info *globalInfo) parsePragmas(doc *ast.CommentGroup) {
if len(parts) == 2 {
info.section = parts[1]
}
case "//go:embed":
raw := strings.TrimPrefix(comment.Text, "//go:embed")
info.embeds += " " + raw
}
}
}