func (s *scanner) scanOperator() (tok token, lit string) {
	// Create a buffer and read the current character into it.
	var buf bytes.Buffer
	buf.WriteRune(s.read())

	// Read every subsequent operator character into the buffer.
	// Non-operator characters and EOF will cause the loop to exit.
	for {
		if ch := s.read(); ch == eof {
			break
		} else if !isOperator(ch) {
			s.unread()
			break
		} else {
			_, _ = buf.WriteRune(ch)
		}
	}

	return tokOperator, buf.String()
}
// scanOperator consumes the current rune and all contiguous operator.
scanOperator consumes the current rune and all contiguous operator.
// scanOperator consumes the current rune and all contiguous operator .
func (s *scanner) scanOperator() (tok token, lit string) {
	var buf bytes.Buffer
	buf.WriteRune(s.read())
	for {
		if ch := s.read(); ch == eof {
			break
		} else if !isOperator(ch) {
			s.unread()
			break
		} else {
			_, _ = buf.WriteRune(ch)
		}
	}
	return tokOperator, buf.String()
}
func ( s * scanner ) scanOperator ( ) ( tok token , lit string ) { var buf bytes . Buffer buf . WriteRune ( s . read ( ) ) for { if ch := s . read ( ) ; ch == eof { break } else if ! isOperator ( ch ) { s . unread ( ) break } else { _ , _ = buf . WriteRune ( ch ) } } return tokOperator , buf . String ( ) }
scanOperator consumes the current rune and all contiguous operator.
scanOperator consumes the current rune and all contiguous operator .
// Create a buffer and read the current character into it. // Read every subsequent operator character into the buffer. // Non-operator characters and EOF will cause the loop to exit.