MParser/Lexer/TextWindowWithNull.cs
2018-03-31 21:51:53 +02:00

20 lines
450 B
C#

namespace Lexer
{
public class TextWindowWithNull : TextWindow
{
public TextWindowWithNull(string text, string fileName = null) : base(text, fileName)
{
}
public override char PeekChar()
{
return IsEof() ? '\0' : base.PeekChar();
}
public override char PeekChar(int n)
{
return Offset + n >= Text.Length ? '\0' : base.PeekChar(n);
}
}
}