protected override int GetOperatorPosition(string value) { IEnumerable <int> splitPoints = TextProcessing.GetScopedSplitPoints(value, OperatorToken, TextProcessing.DefaultLeftScopers, TextProcessing.DefaultRightScopers); foreach (int index in splitPoints.Reverse()) { if (IsValidBinaryOperator(value, index)) { return(index); } } return(-1); }
/// <summary> /// Get the position of the right-most valid operator token. /// </summary> /// <param name="value">The string to find the operator in.</param> /// <returns>The position of the operator. -1 if none can be found</returns> protected virtual int GetOperatorPosition(string value) { return(TextProcessing.GetScopedSplitPoints(value, OperatorToken, TextProcessing.DefaultLeftScopers, TextProcessing.DefaultRightScopers).Last()); }