Skip to content

Commit

Permalink
fixed error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanegv committed Feb 28, 2024
1 parent 61e178e commit 5a21dd0
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions interpreter/eclaType/char.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (c Char) Sub(other Type) (Type, error) {
case *Any:
return c.Sub(other.(*Any).Value)
default:
return nil, errors.New("cannot subtract " + string(other.GetString()) + " from int")
return nil, errors.New("cannot subtract " + string(other.GetString()) + " from char")
}
}

Expand All @@ -107,7 +107,7 @@ func (c Char) Mul(other Type) (Type, error) {
case *Any:
return c.Mul(other.(*Any).Value)
default:
return nil, errors.New("cannot subtract " + string(other.GetString()) + " from int")
return nil, errors.New("cannot multiply " + string(other.GetString()) + " with char")
}
}

Expand All @@ -131,7 +131,7 @@ func (c Char) Div(other Type) (Type, error) {
case *Any:
return c.Div(other.(*Any).Value)
default:
return nil, errors.New("cannot subtract " + string(other.GetString()) + " from int")
return nil, errors.New("cannot divide char by " + string(other.GetString()))
}
}

Expand All @@ -155,7 +155,7 @@ func (c Char) Mod(other Type) (Type, error) {
case *Any:
return c.Mod(other.(*Any).Value)
default:
return nil, errors.New("cannot subtract " + string(other.GetString()) + " from int")
return nil, errors.New("cannot get modulo of char by " + string(other.GetString()))
}
}

Expand All @@ -178,7 +178,7 @@ func (c Char) Eq(other Type) (Type, error) {
case *Any:
return c.Eq(other.(*Any).Value)
default:
return nil, errors.New("cannot compare " + string(other.GetString()) + " to int")
return nil, errors.New("cannot compare " + string(other.GetString()) + " to char")
}
}

Expand Down Expand Up @@ -206,7 +206,7 @@ func (c Char) Gt(other Type) (Type, error) {
case *Any:
return c.Gt(other.(*Any).Value)
default:
return nil, errors.New("cannot compare " + string(other.GetString()) + " to int")
return nil, errors.New("cannot compare " + string(other.GetString()) + " to char")
}
}

Expand All @@ -224,7 +224,7 @@ func (c Char) GtEq(other Type) (Type, error) {
case *Any:
return c.GtEq(other.(*Any).Value)
default:
return nil, errors.New("cannot compare " + string(other.GetString()) + " to int")
return nil, errors.New("cannot compare " + string(other.GetString()) + " to char")
}
}

Expand All @@ -242,7 +242,7 @@ func (c Char) Lw(other Type) (Type, error) {
case *Any:
return c.Lw(other.(*Any).Value)
default:
return nil, errors.New("cannot compare " + string(other.GetString()) + " to int")
return nil, errors.New("cannot compare " + string(other.GetString()) + " to char")
}
}

Expand All @@ -260,7 +260,7 @@ func (c Char) LwEq(other Type) (Type, error) {
case *Any:
return c.LwEq(other.(*Any).Value)
default:
return nil, errors.New("cannot compare " + string(other.GetString()) + " to int")
return nil, errors.New("cannot compare " + string(other.GetString()) + " to char")
}
}

Expand Down Expand Up @@ -298,7 +298,7 @@ func (c Char) And(other Type) (Type, error) {
case *Any:
return c.And(other.(*Any).Value)
default:
return nil, errors.New(string("cannot compare bool to " + other.GetString()))
return nil, errors.New(string("cannot compare char to " + other.GetString()))
}
}

Expand Down Expand Up @@ -336,7 +336,7 @@ func (c Char) Or(other Type) (Type, error) {
case *Any:
return c.Or(other.(*Any).Value)
default:
return nil, errors.New(string("cannot compare bool to " + other.GetString()))
return nil, errors.New(string("cannot compare char to " + other.GetString()))
}
}

Expand Down Expand Up @@ -391,7 +391,7 @@ func (c Char) Xor(other Type) (Type, error) {
case *Any:
return c.Xor(other.(*Any).Value)
default:
return nil, errors.New(string("cannot compare bool to " + other.GetString()))
return nil, errors.New(string("cannot compare char to " + other.GetString()))
}
}

Expand Down

0 comments on commit 5a21dd0

Please sign in to comment.