lang: allow "slice_var as ptr array[etc] etc"

This commit is contained in:
Nigel Tao committed 2023-06-13 22:38:25 +10:00
1 parent 6411561deb
commit 19f56ebfd2
7 files changed
+83 -5

No files matched your search

+4
View File
@@ -342,6 +342,10 @@ func (g *gen) writeVars(b *buffer, f *funk, inStructDecl bool) error {
return fmt.Errorf("TODO: support token_{reader,writer} typed variables")
}
if typ.IsPointerType() && typ.IsRecursivelyReadOnly() {
b.writes("const ")
}
if err := g.writeCTypeName(b, typ, vPrefix, name); err != nil {
return err
}