Added string constructor for entity.Operator

This commit is contained in:
Sasha Koshka 2024-02-08 00:29:24 -05:00
parent 0bed97da02
commit d7d2d90b20
1 changed files with 2 additions and 4 deletions

View File

@ -1,7 +1,6 @@
package entity
import "fmt"
import "strings"
import "git.tebibyte.media/sashakoshka/fspl/errors"
// Signature is a function or method signature that is used in functions,
@ -131,9 +130,8 @@ func init () {
}
}
func (this *Operator) Capture (str []string) error {
*this = stringToOperator[strings.Join(str, "")]
return nil
func OperatorFromString (str string) Operator {
return stringToOperator[str]
}
func (this Operator) String () string {