code: func (p *Parser) parseCaretBraces() (Revisioner, error) {
  	var tok, nextTok token
  	var lit, _ string
  	start := true
  	var re string
  	var negate bool
  	var err error
  
  	for {
  		tok, lit, err = p.scan()
  
  		if err != nil {
  			return nil, err
  		}
  
  		nextTok, _, err = p.scan()
  
  		if err != nil {
  			return nil, err
  		}
  
  		switch {
  		case tok == word && nextTok == cbrace && (lit == "commit" || lit == "tree" || lit == "blob" || lit == "tag" || lit == "object"):
  			return CaretType{lit}, nil
  		case re == "" && tok == cbrace:
  			return CaretType{"tag"}, nil
  		case re == "" && tok == emark && nextTok == emark:
  			re += lit
  		case re == "" && tok == emark && nextTok == minus:
  			negate = true
  		case re == "" && tok == emark:
  			return nil, &ErrInvalidRevision{fmt.Sprintf(`revision suffix brace component sequences starting with "/!" others than those defined are reserved`)}
  		case re == "" && tok == slash:
  			p.unscan()
  		case tok != slash && start:
  			return nil, &ErrInvalidRevision{fmt.Sprintf(`"%s" is not a valid revision suffix brace component`, lit)}
  		case tok != cbrace:
  			p.unscan()
  			re += lit
  		case tok == cbrace:
  			p.unscan()
  
  			reg, err := regexp.Compile(re)
  
  			if err != nil {
  				return CaretReg{}, &ErrInvalidRevision{fmt.Sprintf(`revision suffix brace component, %s`, err.Error())}
  			}
  
  			return CaretReg{reg, negate}, nil
  		}
  
  		start = false
  	}
  }
docs: // parseCaretBraces extract ^{<data>} statements