Skip to content

Commit

Permalink
fix(schema): handle parsing of "listpairs" in the DSL
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Apr 26, 2023
1 parent 9f519f1 commit 5f65ed8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions schema/dmt/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ func spawnType(ts *schema.TypeSystem, name schema.TypeName, defn TypeDefn) (sche
return nil, fmt.Errorf("stringjoin has empty join value")
}
repr = schema.SpawnStructRepresentationStringjoin(join)
case typ.Representation.StructRepresentation_Listpairs != nil:
repr = schema.SpawnStructRepresentationListPairs()
default:
return nil, fmt.Errorf("TODO: support other struct repr in schema package")
}
Expand Down
3 changes: 3 additions & 0 deletions schema/dsl/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,9 @@ func (p *parser) typeStruct() (*dmt.TypeDefnStruct, error) {
Join: join,
}
return defn, nil
case "listpairs":
defn.Representation.StructRepresentation_Listpairs = &dmt.StructRepresentation_Listpairs{}
return defn, nil
default:
return nil, p.errf("unknown struct repr: %q", reprName)
}
Expand Down

0 comments on commit 5f65ed8

Please sign in to comment.