Function feedInput [src]

Call this whenever you get error.BufferUnderrun from next(). When there is no more input to provide, call endInput().

Prototype

pub fn feedInput(self: *@This(), input: []const u8) void

Parameters

self: *@This()input: []const u8

Source

pub fn feedInput(self: *@This(), input: []const u8) void { assert(self.cursor == self.input.len); // Not done with the last input slice. if (self.diagnostics) |diag| { diag.total_bytes_before_current_input += self.input.len; // This usually goes "negative" to measure how far before the beginning // of the new buffer the current line started. diag.line_start_cursor -%= self.cursor; } self.input = input; self.cursor = 0; self.value_start = 0; }