Exemplo n.º 1
0
        static Match TryMatchFilter(
            syn.TokenKind kind,
            string src, int index,
            System.Func <char, bool> filterPrefix,
            System.Func <char, bool> filterRest)
        {
            if (!filterPrefix(src[index]))
            {
                return(null);
            }

            var length = 1;

            while (index + length < src.Length && filterRest(src[index + length]))
            {
                length++;
            }

            return(new Match(src.Substring(index, length), kind));
        }
Exemplo n.º 2
0
 public Match(string excerpt, syn.TokenKind kind)
 {
     this.excerpt = excerpt;
     this.kind    = kind;
 }