public Comment(CharacterBuffer buffer) { //this.Image = ImageType.Comment; this.Start = buffer.IndexInOriginalBuffer; do { if (buffer.IsAtEnd) { break; } buffer.MoveNext(); } while (buffer.CurrentCharacter != '\n'); this.End = buffer.IndexInOriginalBuffer; this.Literal = buffer.Substring(this.Start - buffer.Offset, this.End - this.Start); this.contents = this.Literal.Remove(0, 1).Trim(); this.Description = string.Concat("Comment: ", this.contents); buffer.MoveNext(); }
public Character(CharacterBuffer buffer, bool repetitionsOnly) { //this.Image = ImageType.Character; Start = buffer.IndexInOriginalBuffer; if (buffer.IsAtEnd) { Utility.ParseError("Reached end of buffer in Character constructor!", buffer); IsValid = false; } else if (repetitionsOnly) { _character = buffer.CurrentCharacter.ToString(); ParseRepetitions(buffer); return; } _character = buffer.CurrentCharacter.ToString(); Literal = _character; Description = Literal; buffer.MoveNext(); ParseRepetitions(buffer); }