code: func (p *parser) pattern(t *Token) ([]*Token, Error) {
  	// build the list of tokens that may appear after a pattern
  	_tokens := []*Token{t}
  	_token, _err := p.next()
  	if _err != nil {
  		return _tokens, _err
  	}
  
  	// what tokens are we allowed to have follow a pattern?
  	var _next []*Token
  	switch _token.Type {
  	case SEPARATOR:
  		_next, _err = p.separator(_token)
  		return append(_tokens, _next...), _err
  
  	case WHITESPACE:
  		fallthrough
  	case PATTERN:
  		_next, _err = p.pattern(_token)
  		return append(_tokens, _next...), _err
  
  	// if we encounter end of line or file we are done
  	case EOL:
  		fallthrough
  	case EOF:
  		return _tokens, nil
  	}
  
  	// any other token is invalid
  	p.undo(_token)
  	return _tokens, p.err(InvalidPatternError)
  }
docs: // pattern attempts to retrieve a valid sequence of tokens that may appear
  // after the path pattern Token t. An Error is returned if the sequence if
  // tokens is not valid, or if there is an error extracting tokens from the
  // input stream.