public static void TrimWhitespace(this IProcessorState processor, bool forward, bool backward, ref int bufferLength, ref int currentBufferPosition) { if (backward) { processor.SeekBackWhile(processor.EncodingConfig.Whitespace); } if (forward) { processor.SeekForwardWhile(processor.EncodingConfig.Whitespace, ref bufferLength, ref currentBufferPosition); //Consume the trailing line end if possible int tok; processor.EncodingConfig.LineEndings.GetOperation(processor.CurrentBuffer, bufferLength, ref currentBufferPosition, out tok); } }
public static void ConsumeWholeLine(this IProcessorState processor, ref int bufferLength, ref int currentBufferPosition) { processor.SeekBackWhile(processor.EncodingConfig.Whitespace); processor.SeekForwardThrough(processor.EncodingConfig.LineEndings, ref bufferLength, ref currentBufferPosition); }