Exemple #1
0
        /// <summary>
        /// Concatenate two elements into a new <see cref="Pattern"/>.
        /// </summary>
        /// <param name="left">The first element to concatenate.</param>
        /// <param name="right">The second element to concatenate.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException"><paramref name="right"/> is <c>null</c>.</exception>
        public static Pattern operator +(char left, Pattern right)
        {
            if (right == null)
            {
                throw new ArgumentNullException(nameof(right));
            }

            return(Patterns.Character(left).Append(right));
        }
Exemple #2
0
        /// <summary>
        /// Concatenate two elements into a new <see cref="Pattern"/>.
        /// </summary>
        /// <param name="left">The first element to concatenate.</param>
        /// <param name="right">The second element to concatenate.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException"><paramref name="left"/> is <c>null</c>.</exception>
        public static Pattern operator +(Pattern left, char right)
        {
            if (left == null)
            {
                throw new ArgumentNullException(nameof(left));
            }

            return(left.Append(Patterns.Character(right)));
        }