fork of indigo with slightly nicer lexgen

generate NSIDs consts for all top-level types

now for XRPC lexicons too!

Changed files
+11 -4
lex
+11 -4
lex/gen.go
··· 145 145 146 146 tps := s.AllTypes(pkg.Prefix, defmap) 147 147 148 + // write NSIDs for top level types 148 149 pf("const (") 149 - for _, t := range tps { 150 - // this seems to be the way to ignore non-top level types 151 - if !strings.Contains(t.Name, "_") { 152 - pf("%sNSID = %q", t.Name, t.Type.id) 150 + // for _, t := range tps { 151 + // // this seems to be the way to ignore non-top level types 152 + // if !strings.Contains(t.Name, "_") { 153 + // pf("%sNSID = %q", t.Name, t.Type.id) 154 + // } 155 + // } 156 + if reqcode { 157 + name := nameFromID(s.ID, pkg.Prefix) 158 + if _, ok := s.Defs["main"]; ok { 159 + pf("%sNSID = %q\n", name, s.ID) 153 160 } 154 161 } 155 162 pf(")\n\n")