feat: rename repr to expr

This commit is contained in:
2026-02-07 10:25:20 -05:00
parent bbe027e9f4
commit a790a293cf
9 changed files with 54 additions and 50 deletions

View File

@@ -10,7 +10,7 @@ type Conversion interface {
InType() string
OutType() string
Run(Repr) (Repr, error)
Run(Expr) (Expr, error)
}
type convertedConversion[T, U any] struct {
@@ -18,8 +18,8 @@ type convertedConversion[T, U any] struct {
inType, outType string
}
func (c convertedConversion[T, U]) Run(r Repr) (Repr, error) {
t, ok := r.Data().(T)
func (c convertedConversion[T, U]) Run(expr Expr) (Expr, error) {
t, ok := expr.Data().(T)
if !ok {
return nil, fmt.Errorf("could not parse '%v' as '%s'", t, c.inType)
}
@@ -29,7 +29,7 @@ func (c convertedConversion[T, U]) Run(r Repr) (Repr, error) {
return nil, err
}
return NewRepr(c.outType, u), nil
return NewExpr(c.outType, u), nil
}
func (c convertedConversion[T, U]) InType() string { return c.inType }