(zilch lang go): fix go file parser with all: go:embed patterns

Technically this isn't quite right, as the full list of files is not
available to the go parser (some files are filtered out too early in
the process), but it should do the job for now.
This commit is contained in:
puck 2024-11-17 18:24:00 +00:00
parent a2bae93771
commit b59fd781d0

View file

@ -258,6 +258,8 @@ func main() {
for _, pattern := range pkg.EmbedPatterns {
matchedFiles := []string{}
storePattern := pattern
// TODO: proper matching
if strings.HasPrefix(pattern, "all:") {
pattern = pattern[4:]
@ -293,7 +295,7 @@ func main() {
split = append(split, []string{match[len(dir)+1:], dirname, filepath.Base(match)})
}
out.Embeds[pattern] = split
out.Embeds[storePattern] = split
}
outfiles[dir] = out