Skip to content

Incremental parsing

LPeter1997 edited this page Apr 13, 2019 · 2 revisions

Note: This feature is still experimental and highly inefficient.

If you are still new to this library, please read basic usage first!

For incremental parsing you need to use the parser wrapper. The parser.parse(source) method will always do a full-parse, while the parser.reparse(source, edit_start, erase_length, insert_length) will do an incremental parse based on the given extra 3 arguments. Those 3 arguments describe the edit operation, which modified the input by:

  1. Removing the interval [edit_start; edit_start + erase_length)
  2. Inserting an interval [edit_start; edit_start + insert_length)

The parser.reparse(...) method will give you the full result, just like parser.parse(...).

Clone this wiki locally