This commit is contained in:
Kovid Goyal 2016-11-19 11:44:53 +05:30
parent e3b9bfd4bb
commit 0ccdebe7f0
3 changed files with 9 additions and 2 deletions

View File

@ -279,8 +279,9 @@ PyObject* parse_bytes_dump(PyObject UNUSED *, PyObject *);
PyObject* parse_bytes(PyObject UNUSED *, PyObject *);
uint16_t* translation_table(char);
uint32_t decode_utf8(uint32_t*, uint32_t*, uint8_t byte);
Savepoint* savepoints_pop(SavepointBuffer *pts);
Savepoint* savepoints_push(SavepointBuffer *pts);
Savepoint* savepoints_pop(SavepointBuffer *);
Savepoint* savepoints_push(SavepointBuffer *);
void savepoints_init(SavepointBuffer *);
void cursor_reset(Cursor*);
Cursor* cursor_copy(Cursor*);
void cursor_copy_to(Cursor *src, Cursor *dest);

View File

@ -24,3 +24,8 @@ Savepoint* savepoints_pop(SavepointBuffer *self) {
RETREAT(end_of_data);
return self->end_of_data;
}
void savepoints_init(SavepointBuffer *self) {
self->end_of_data = self->buf;
self->start_of_data = self->buf;
}

View File

@ -39,6 +39,7 @@ new(PyTypeObject *type, PyObject *args, PyObject UNUSED *kwds) {
if (self->cursor == NULL || self->main_linebuf == NULL || self->alt_linebuf == NULL || self->change_tracker == NULL || self->tabstops == NULL) {
Py_CLEAR(self); return NULL;
}
savepoints_init(&self->main_savepoints); savepoints_init(&self->alt_savepoints);
}
return (PyObject*) self;
}