code: func (p *Parser) parseTagKeyExpr() (Token, Literal, error) {
  	var err error
  
  	// Parse required WITH KEY tokens.
  	if err := p.parseTokens([]Token{WITH, KEY}); err != nil {
  		return 0, nil, err
  	}
  
  	// Parse required IN, EQ, or EQREGEX token.
  	tok, pos, lit := p.ScanIgnoreWhitespace()
  	if tok == IN {
  		// Parse required ( token.
  		if tok, pos, lit = p.ScanIgnoreWhitespace(); tok != LPAREN {
  			return 0, nil, newParseError(tokstr(tok, lit), []string{"("}, pos)
  		}
  
  		// Parse tag key list.
  		var tagKeys []string
  		if tagKeys, err = p.ParseIdentList(); err != nil {
  			return 0, nil, err
  		}
  
  		// Parse required ) token.
  		if tok, pos, lit = p.ScanIgnoreWhitespace(); tok != RPAREN {
  			return 0, nil, newParseError(tokstr(tok, lit), []string{")"}, pos)
  		}
  		return IN, &ListLiteral{Vals: tagKeys}, nil
  	} else if tok == EQ || tok == NEQ {
  		// Parse required tag key.
  		ident, err := p.ParseIdent()
  		if err != nil {
  			return 0, nil, err
  		}
  		return tok, &StringLiteral{Val: ident}, nil
  	} else if tok == EQREGEX || tok == NEQREGEX {
  		re, err := p.parseRegex()
  		if err != nil {
  			return 0, nil, err
  		} else if re == nil {
  			// parseRegex can return an empty type, but we need it to be present
  			tok, pos, lit := p.ScanIgnoreWhitespace()
  			return 0, nil, newParseError(tokstr(tok, lit), []string{"regex"}, pos)
  		}
  		return tok, re, nil
  	}
  	return 0, nil, newParseError(tokstr(tok, lit), []string{"IN", "=", "=~"}, pos)
  }
docs: // parseTagKeys parses a string and returns a list of tag keys.