public override void Read(Tokeniser t, CharacterReader r)
            {
                char c = r.Consume();

                switch (c)
                {
                case '-':
                    t.Transition(CommentStartDash);
                    break;

                case nullChar:
                    t.Error(this);
                    t.commentPending.data.Append(replacementChar);
                    t.Transition(Comment);
                    break;

                case '>':
                    t.Error(this);
                    t.EmitCommentPending();
                    t.Transition(Data);
                    break;

                case eof:
                    t.EofError(this);
                    t.EmitCommentPending();
                    t.Transition(Data);
                    break;

                default:
                    t.commentPending.data.Append(c);
                    t.Transition(Comment);
                    break;
                }
            }
            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;
                }
            }