// Tokenise takes an expr string and converts it to a slice of tokens
//
// Tokenise puts spaces around all non-numbers, removes leading and
// trailing spaces, then splits on spaces
//
Tokenise takes an expr string and converts it to a slice of tokens

Tokenise puts spaces around all non-numbers, removes leading and
trailing spaces, then splits on spaces
// Tokenise takes an expr string and converts it to a slice of tokens // // Tokenise puts spaces around all non - numbers removes leading and // trailing spaces then splits on spaces //
func Tokenise(expr string) []string {
	spaced := unary_minus_rx.ReplaceAllString(expr, "$1 @")
	spaced = fp_rx.ReplaceAllString(spaced, " ${1} ")
	spaced = functions_rx.ReplaceAllString(spaced, " ${1} ")
	if symbols_rx != nil {
		spaced = symbols_rx.ReplaceAllString(spaced, " ${1} ")
	}
	symbols := []string{"(", ")"}
	for _, symbol := range symbols {
		spaced = strings.Replace(spaced, symbol, fmt.Sprintf(" %s ", symbol), -1)
	}
	stripped := whitespace_rx.ReplaceAllString(strings.TrimSpace(spaced), "|")
	result := strings.Split(stripped, "|")
	return result
}
func Tokenise ( expr string ) [ ] string { spaced := unary_minus_rx . ReplaceAllString ( expr , " " ) spaced = fp_rx . ReplaceAllString ( spaced , " " ) spaced = functions_rx . ReplaceAllString ( spaced , " " ) if symbols_rx != nil { spaced = symbols_rx . ReplaceAllString ( spaced , " " ) } symbols := [ ] string { " " , " " } for _ , symbol := range symbols { spaced = strings . Replace ( spaced , symbol , fmt . Sprintf ( " " , symbol ) , - 1 ) } stripped := whitespace_rx . ReplaceAllString ( strings . TrimSpace ( spaced ) , " " ) result := strings . Split ( stripped , " " ) return result }
Tokenise takes an expr string and converts it to a slice of tokens
Tokenise takes an expr string and converts it to a slice of tokens