예제 #1
0
        /// <summary>
        /// Attempt to combine another match with this match. If possible, all words from the other
        /// match are appended to this match and the other match can be removed.
        /// </summary>
        /// <param name="other">The match to append.</param>
        /// <returns><c>true</c> if the matches were combined, otherwise <c>false</c>.</returns>
        public bool TryAppend(CodeCommentMatch other)
        {
            if (other == null)
            {
                return(false);
            }

            if (IsEmpty || other.IsEmpty)
            {
                return(false);
            }

            if (other.IsList)
            {
                return(false);
            }

            if (IsList && other.Indent < 1)
            {
                return(false);
            }

            foreach (var word in other.Words)
            {
                Words.Add(word);
            }

            IsEmpty = Words.Count < 1;

            return(true);
        }
예제 #2
0
        /// <summary>
        /// Attempt to combine another match with this match. If possible, all words from the other
        /// match are appended to this match and the other match can be removed.
        /// </summary>
        /// <param name="other">The match to append.</param>
        /// <returns><c>true</c> if the matches were combined, otherwise <c>false</c>.</returns>
        public bool TryAppend(CodeCommentMatch other)
        {
            if (other == null)
            {
                return(false);
            }

            if (IsEmpty || other.IsEmpty)
            {
                return(false);
            }

            if (other.IsList)
            {
                return(false);
            }

            if (IsList && other.Indent < 1)
            {
                return(false);
            }

            if (IsLiteral || other.IsLiteral)
            {
                return(false);
            }

            Words.AddRange(other.Words);
            IsEmpty = Words.Count < 1;

            return(true);
        }
예제 #3
0
        /// <summary>
        /// Attempt to combine another match with this match. If possible, all words from the other
        /// match are appended to this match and the other match can be removed.
        /// </summary>
        /// <param name="other">The match to append.</param>
        /// <returns><c>true</c> if the matches were combined, otherwise <c>false</c>.</returns>
        public bool TryAppend(CodeCommentMatch other)
        {
            if (other == null)
                return false;

            if (IsEmpty || other.IsEmpty)
                return false;

            if (other.IsList)
                return false;

            if (IsList && other.Indent < 1)
                return false;

            foreach (var word in other.Words)
                Words.Add(word);

            IsEmpty = Words.Count < 1;

            return true;
        }