コード例 #1
0
        public static DList <Token> ToNormalTokens(SparseAList <EditorToken> eTokens)
        {
            var output = new DList <Token>();
            int?index  = null;

            for (;;)
            {
                EditorToken eTok = eTokens.NextHigherItem(ref index);
                if (index == null)
                {
                    break;
                }
                output.Add(eTok.ToToken(index.Value));
            }
            return(output);
        }
コード例 #2
0
 void AddLexerErrors(NormalizedSnapshotSpanCollection spans, List <ITagSpan <ErrorTag> > errors)
 {
     if (_haveLexerErrors)
     {
         foreach (var span in spans)
         {
             int?        i = span.Start.Position + 1;
             EditorToken t = _tokens.NextLowerItem(ref i);
             while (i != null)
             {
                 do
                 {
                     if (t.Value is LexerMessage)
                     {
                         errors.Add(LexerMessageToErrorTagSpan(span.Snapshot, t.ToToken(i.Value, false), t.Value as LexerMessage));
                     }
                     t = _tokens.NextHigherItem(ref i);
                 }while (i < span.End.Position);
             }
         }
     }
 }