コード例 #1
0
ファイル: HintResult.cs プロジェクト: stantoxt/tokenizer
        internal bool AddMiss(Hint hint)
        {
            if (Misses.Any(m => m.Text == hint.Text) ||
                Matches.Any(m => m.Text == hint.Text))
            {
                return(false);
            }

            Misses.Add(hint.Clone());

            return(true);
        }
コード例 #2
0
ファイル: HintResult.cs プロジェクト: stantoxt/tokenizer
        internal bool AddMatch(Hint hint, TokenEnumerator enumerator)
        {
            if (Matches.Any(m => m.Text == hint.Text))
            {
                return(false);
            }

            Matches.Add(new HintMatch
            {
                Text     = hint.Text,
                Optional = hint.Optional,
                Location = enumerator.Location.Clone()
            });

            return(true);
        }