/// <summary> /// Gets the seperator. /// </summary> /// <param name="token">The token.</param> /// <returns></returns> public RuleSeparator GetSeperator(string token) { RuleSeparator separator = Separators.FirstOrDefault(seperator => seperator.Value == token); if (separator == null) { return(null); } char?ignoreChar = this.SeparatorIgnoreStack.Count > 0 ? (char?)this.SeparatorIgnoreStack.Peek() : null; char?ruleIgnoreChar = separator.SeparatorIgnore; if (ignoreChar != ruleIgnoreChar) { //separator is not withinn ignore section return(separator); } //ignore separator if is is within ignore block return(null); }
/// <summary> /// Determines whether [contains ignore char] [the specified token]. /// </summary> /// <param name="token">The token.</param> /// <returns> /// <c>true</c> if [contains ignore char] [the specified token]; otherwise, <c>false</c>. /// </returns> public bool ContainsIgnoreChar(string token) { return(Separators.FirstOrDefault(separator => token.Contains(separator.SeparatorIgnore.ToString())) != null); }