Example #1
0
        private static ParseResult MatchAndConsumeCurrentChar(InputStream input)
        {
            var result = new ParseResult(input.CurrentChar.ToString());

            input.Consume(1);
            return(result);
        }
Example #2
0
        /// <summary>
        /// The PEG "dot" operator that matches and consumes one character.
        /// </summary>
        /// <param name="input">Input to the parser.</param>
        /// <returns>The parse result.</returns>
        public static ParseResult Any(InputStream input)
        {
            if (input.AtEnd)
            {
                return matchFailed;
            }

            var result = new ParseResult(input.CurrentChar.ToString());

            input.Consume(1);
            return result;
        }
Example #3
0
        /// <summary>
        /// The PEG "dot" operator that matches and consumes one character.
        /// </summary>
        /// <param name="input">Input to the parser.</param>
        /// <returns>The parse result.</returns>
        public static ParseResult Any(InputStream input)
        {
            if (input.AtEnd)
            {
                return(MatchFailed);
            }

            var result = new ParseResult(input.CurrentChar.ToString());

            input.Consume(1);
            return(result);
        }
Example #4
0
 private static ParseResult MatchAndConsumeCurrentChar(InputStream input)
 {
     var result = new ParseResult(input.CurrentChar.ToString());
     input.Consume(1);
     return result;
 }