Microsoft.R.Core.AST.Operators.FunctionCall.GetParameterIndex C# (CSharp) Method

GetParameterIndex() public method

public GetParameterIndex ( int position ) : int
position int
return int
        public int GetParameterIndex(int position) {
            if (position > End || position < OpenBrace.End) {
                return -1;
            }

            if (Arguments.Count == 0) {
                return 0;
            }

            for (int i = 0; i < Arguments.Count; i++) {
                IAstNode arg = Arguments[i];
                if (arg is ErrorArgument) {
                    continue;
                }

                if (position < arg.End || (arg is MissingArgument && arg.Start == arg.End && arg.Start == 0)) {
                    return i;
                }
            }

            return Arguments.Count - 1;
        }