Esempio n. 1
0
 public override void Read(Tokeniser t, CharacterReader r)
 {
     char c = r.Consume();
     switch (c)
     {
         case '-':
             t.CommentPending.Data.Append("--!");
             t.Transition(CommentEndDash);
             break;
         case '>':
             t.EmitCommentPending();
             t.Transition(Data);
             break;
         case _nullChar:
             t.Error(this);
             t.CommentPending.Data.Append("--!").Append(_replacementChar);
             t.Transition(Comment);
             break;
         case _eof:
             t.EofError(this);
             t.EmitCommentPending();
             t.Transition(Data);
             break;
         default:
             t.CommentPending.Data.Append("--!").Append(c);
             t.Transition(Comment);
             break;
     }
 }
Esempio n. 2
0
 public override void Read(Tokeniser t, CharacterReader r)
 {
     char c = r.Current();
     switch (c)
     {
         case '-':
             t.AdvanceTransition(CommentEndDash);
             break;
         case _nullChar:
             t.Error(this);
             r.Advance();
             t.CommentPending.Data.Append(_replacementChar);
             break;
         case _eof:
             t.EofError(this);
             t.EmitCommentPending();
             t.Transition(Data);
             break;
         default:
             t.CommentPending.Data.Append(r.ConsumeToAny('-', _nullChar));
             break;
     }
 }