mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-14 10:55:04 +08:00

since both pdfs and Adobe Type1 fonts use postscript type objects, tokenization is needed by the main project and the fonts project
29 lines
657 B
C#
29 lines
657 B
C#
namespace UglyToad.PdfPig.Tokenization
|
|
{
|
|
using Core;
|
|
using Tokens;
|
|
|
|
/// <summary>
|
|
/// Read an <see cref="EndOfLineToken"/>.
|
|
/// </summary>
|
|
public class EndOfLineTokenizer : ITokenizer
|
|
{
|
|
/// <inheritdoc />
|
|
public bool ReadsNextByte { get; } = false;
|
|
|
|
/// <inheritdoc />
|
|
public bool TryTokenize(byte currentByte, IInputBytes inputBytes, out IToken token)
|
|
{
|
|
token = null;
|
|
if (currentByte != '\r' && currentByte != '\n')
|
|
{
|
|
return false;
|
|
}
|
|
|
|
token = EndOfLineToken.Token;
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|