// lexInsideAction scans the elements inside action delimiters.
432981
func lexInsideAction(l *lexer) stateFn {
	// Either number, quoted string, or identifier.
	// Spaces separate arguments; runs of spaces turn into itemSpace.
	// Pipe symbols separate and are emitted.
	if strings.HasPrefix(l.input[l.pos:], l.rightDelim) {
		if l.parenDepth == 0 {
			return lexRightDelim
		}
		return l.errorf("unclosed left paren")
	}
	switch r := l.next(); {
	case r == eof:
		return l.errorf("unclosed action")
	case isSpace(r):
		return lexSpace
	case r == ',':
		l.emit(itemComma)
	case r == ';':
		l.emit(itemSemicolon)
	case r == '*':
		l.emit(itemMul)
	case r == '/':
		l.emit(itemDiv)
	case r == '%':
		l.emit(itemMod)
	case r == '-':

		if r := l.peek(); '0' <= r && r <= '9' &&
			itemAdd != l.lastType &&
			itemMinus != l.lastType &&
			itemNumber != l.lastType &&
			itemIdentifier != l.lastType &&
			itemString != l.lastType &&
			itemRawString != l.lastType &&
			itemCharConstant != l.lastType &&
			itemBool != l.lastType &&
			itemField != l.lastType &&
			itemChar != l.lastType &&
			itemTrans != l.lastType {
			l.backup()
			return lexNumber
		}
		l.emit(itemMinus)
	case r == '+':
		if r := l.peek(); '0' <= r && r <= '9' &&
			itemAdd != l.lastType &&
			itemMinus != l.lastType &&
			itemNumber != l.lastType &&
			itemIdentifier != l.lastType &&
			itemString != l.lastType &&
			itemRawString != l.lastType &&
			itemCharConstant != l.lastType &&
			itemBool != l.lastType &&
			itemField != l.lastType &&
			itemChar != l.lastType &&
			itemTrans != l.lastType {
			l.backup()
			return lexNumber
		}
		l.emit(itemAdd)
	case r == '?':
		l.emit(itemTernary)
	case r == '&':
		if l.next() == '&' {
			l.emit(itemAnd)
		} else {
			l.backup()
		}
	case r == '<':
		if l.next() == '=' {
			l.emit(itemLessEquals)
		} else {
			l.backup()
			l.emit(itemLess)
		}
	case r == '>':
		if l.next() == '=' {
			l.emit(itemGreatEquals)
		} else {
			l.backup()
			l.emit(itemGreat)
		}
	case r == '!':
		if l.next() == '=' {
			l.emit(itemNotEquals)
		} else {
			l.backup()
			l.emit(itemNot)
		}

	case r == '=':
		if l.next() == '=' {
			l.emit(itemEquals)
		} else {
			l.backup()
			l.emit(itemAssign)
		}
	case r == ':':
		if l.next() == '=' {
			l.emit(itemAssign)
		} else {
			l.backup()
			l.emit(itemColon)
		}
	case r == '|':
		if l.next() == '|' {
			l.emit(itemOr)
		} else {
			l.backup()
			l.emit(itemPipe)
		}
	case r == '"':
		return lexQuote
	case r == '`':
		return lexRawQuote
	case r == '\'':
		return lexChar
	case r == '.':
		// special look-ahead for ".field" so we don't break l.backup().
		if l.pos < Pos(len(l.input)) {
			r := l.input[l.pos]
			if r < '0' || '9' < r {
				return lexField
			}
		}
		fallthrough // '.' can start a number.
	case '0' <= r && r <= '9':
		l.backup()
		return lexNumber
	case isAlphaNumeric(r):
		l.backup()
		return lexIdentifier
	case r == '[':
		l.emit(itemLeftBrackets)
	case r == ']':
		l.emit(itemRightBrackets)
	case r == '(':
		l.emit(itemLeftParen)
		l.parenDepth++
	case r == ')':
		l.emit(itemRightParen)
		l.parenDepth--
		if l.parenDepth < 0 {
			return l.errorf("unexpected right paren %#U", r)
		}
	case r <= unicode.MaxASCII && unicode.IsPrint(r):
		l.emit(itemChar)
		return lexInsideAction
	default:
		return l.errorf("unrecognized character in action: %#U", r)
	}
	return lexInsideAction
}
607864
func (c *Client) FindActionsByNames(arg params.FindActionsByNames) (params.ActionsByNames, error) {
	results := params.ActionsByNames{}
	err := c.facade.FacadeCall("FindActionsByNames", arg, &results)
	return results, err
}
205202
func (c *Client) deleteAction(ctx context.Context, path string, apiversion string) (string, *APIResponse, error) {
	a := StringResponse{}
	_, resp, err := c.httpAction(ctx, &APIClientRequest{
		Method:       "DELETE",
		Path:         path,
		APIVersion:   apiversion,
		ResponseType: responseTypeJSON,
		ResponseBody: &a,
	})

	return a.Message, resp, err
}
1067454
func (f *factory) NewAction(actionId string) (Operation, error) {
	if !names.IsValidAction(actionId) {
		return nil, errors.Errorf("invalid action id %q", actionId)
	}
	return &runAction{
		actionId:      actionId,
		callbacks:     f.config.Callbacks,
		runnerFactory: f.config.RunnerFactory,
	}, nil
}
1023081
func (f *FlagClause) Action(action Action) *FlagClause {
	f.addAction(action)
	return f
}
1236938
func lexNumber(l *lexer) stateFn {
	if !l.scanNumber() {
		return l.errorf("bad number syntax: %q", l.input[l.start:l.pos])
	}

	l.emit(itemNumber)
	return lexInsideAction
}
158361
func (c *Client) FindActionTagsByPrefix(arg params.FindTags) (params.FindTagsResults, error) {
	results := params.FindTagsResults{}
	err := c.facade.FacadeCall("FindActionTagsByPrefix", arg, &results)
	return results, err
}
544032
func KeyActionNode(n *cdp.Node, keys string, opts ...KeyOption) Action {
	return ActionFunc(func(ctx context.Context) error {
		err := dom.Focus().WithNodeID(n.NodeID).Do(ctx)
		if err != nil {
			return err
		}

		return KeyAction(keys, opts...).Do(ctx)
	})
}
788925
func (t *Tree) action() (n Node) {
	switch token := t.nextNonSpace(); token.typ {
	case itemElse:
		return t.elseControl()
	case itemEnd:
		return t.endControl()
	case itemIf:
		return t.ifControl()
	case itemRange:
		return t.rangeControl()
	case itemTemplate:
		return t.templateControl()
	case itemWith:
		return t.withControl()
	}
	t.backup()
	// Do not pop variables; they persist until "end".
	return t.newAction(t.peek().pos, t.lex.lineNumber(), t.pipeline("command"))
}
148859
func lexIdent(l *lexer) stateFn {
	// the different idents start with different unique characters.
	// peel those off.
	var itemType = itemIdent
	switch l.next() {
	case '.':
		if isDigit(l.next()) {
			itemType = itemDotIndex
		} else {
			itemType = itemDotIdent
		}
		l.backup()
	case '$':
		itemType = itemDollarIdent
	case '/':
		itemType = itemCommandEnd
	case '\\':
		itemType = itemSpecialChar
	case '?':
		dot := l.next()
		if dot != '.' {
			l.errorf("unexpected beginning to ident: ?%v", dot)
		}
		if isDigit(l.next()) {
			itemType = itemQuestionDotIndex
		} else {
			itemType = itemQuestionDotIdent
		}
		l.backup()
	}

	// absorb the rest of the identifier
	for isAlphaNumeric(l.next()) {
	}
	l.backup()
	word := l.input[l.start:l.pos]

	// if it's a builtin, return that item type
	if itemType, ok := builtinIdents[word]; ok {
		l.emit(itemType)
		// {literal} and {css} have unusual lexing rules
		switch itemType {
		case itemLiteral:
			return lexLiteral
		case itemCss:
			return lexCss
		}
		return lexInsideTag
	}
	// if not a builtin, it shouldn't start with / or \
	if itemType == itemCommandEnd || itemType == itemSpecialChar {
		var str = l.input[l.start:l.pos]
		l.pos = l.start
		return l.errorf("unrecognized identifier %q", str)
	}

	// else, use the type determined at the beginning.
	l.emit(itemType)
	return lexInsideTag
}
215099
func (ar *ActionRepository) RegisterShardAction(name string, method actionShardMethod) {
	ar.shardActions[name] = method
}
796796
func lexLeftDelim(l *lexer) stateFn {
	l.pos += Pos(len(l.leftDelim))
	if strings.HasPrefix(l.input[l.pos:], leftComment) {
		return lexComment
	}
	l.emit(itemLeftDelim)
	l.parenDepth = 0
	return lexInsideAction
}
813671
func (s *StarEvent) GetAction() string {
	if s == nil || s.Action == nil {
		return ""
	}
	return *s.Action
}
499700
func (r *Resource) WithAction(action string) *Resource {
	r.u.RawQuery = url.Values{
		"~action": []string{action},
	}.Encode()
	return r
}
1307939
func lexSpace(l *lexer) stateFn {
	for isSpace(l.peek()) {
		l.next()
	}
	l.emit(itemSpace)
	return lexInsideAction
}
566398
func GetAction(id string) *Action {
	for _, a := range actions {
		if a.ID == id {
			return &a
		}
	}

	return nil
}
173810
func getActionTagByPrefix(api APIClient, prefix string) (names.ActionTag, error) {
	tag := names.ActionTag{}
	actiontags, err := getActionTagsByPrefix(api, prefix)
	if err != nil {
		return tag, err
	}

	if len(actiontags) < 1 {
		return tag, errors.Errorf("actions for identifier %q not found", prefix)
	}

	if len(actiontags) > 1 {
		return tag, errors.Errorf("identifier %q matched multiple actions %v", prefix, actiontags)
	}

	return actiontags[0], nil
}