Skip to content

Commit

Permalink
*: introduce mkmatch tag
Browse files Browse the repository at this point in the history
  • Loading branch information
widmogrod committed Jul 13, 2024
1 parent c75ecdc commit 968fd08
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 212 deletions.
13 changes: 7 additions & 6 deletions example/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ func (s sumVisitor) VisitLeaf(v *Leaf[int]) any {
return v.Value
}

////go:generate go run ../cmd/mkunion/main.go match -name=MyTriesMatch
//type MyTriesMatch[T0, T1 Tree[A], A any] interface {
// MatchLeafs(*Leaf[A], *Leaf[A])
// MatchBranches(*Branch[A], any)
// MatchMixed(any, any)
//}
//go:tag mkmatch:"MyTriesMatch"
//go:tag mkmatch:"MyTriesMatch"
type MyTriesMatch[T0, T1 Tree[A], A any] interface {
MatchLeafs(*Leaf[A], *Leaf[A])
MatchBranches(*Branch[A], any)
MatchMixed(any, any)
}
2 changes: 1 addition & 1 deletion x/schema/location_typed.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (location *TypedLocation) WrapLocation(loc []Location) ([]Location, error)
return loc, nil
}

//go:generate go run ../../cmd/mkunion/main.go match -name=MatchDifference
//go:tag mkmatch:"MatchDifference"
type MatchDifference[A, B shape.Shape] interface {
StructLikes(x *shape.StructLike, y *shape.StructLike)
UnionLikes(x *shape.UnionLike, y *shape.UnionLike)
Expand Down
2 changes: 1 addition & 1 deletion x/storage/schemaless/projection/windowing.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ func (wt *WindowTrigger) Reset() {
wt.ts = wt.initState(wt.td)
}

//go:generate go run ../../../../cmd/mkunion/main.go match -name=EvaluateTrigger
//go:tag mkmatch:"EvaluateTrigger"
type EvaluateTrigger[T0 TriggerDescription, T1 TriggerType] interface {
MatchPeriod(*AtPeriod, *AtPeriod)
MatchCount(*AtWindowItemSize, *AtWindowItemSize)
Expand Down
204 changes: 0 additions & 204 deletions x/storage/schemaless/projection/windowing_match_evaluatetrigger.go

This file was deleted.

0 comments on commit 968fd08

Please sign in to comment.