示例#1
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;
        }
示例#2
0
 private static ParseResult MatchAndConsumeCurrentChar(InputStream input)
 {
     var result = new ParseResult(input.CurrentChar.ToString());
     input.Consume(1);
     return result;
 }