Fix incremental parsing

Stop collapsing hidden symbols upon reducing them.
Sadly, this messes up the ability to re-use parse
trees. Instead, for now, hide these nodes when
stringifying parse trees
This commit is contained in:
Max Brunsfeld 2014-03-19 19:27:31 -07:00
parent 7e94a4f1b2
commit fbe8b0a905
8 changed files with 89 additions and 68 deletions

View file

@ -5,7 +5,7 @@ extern "C" ts_parser ts_parser_json();
START_TEST
describe("parsing", [&]() {
describe("incremental parsing", [&]() {
ts_document *doc;
SpyReader *reader;
@ -66,7 +66,7 @@ describe("parsing", [&]() {
it("re-reads only the changed portion of the input", [&]() {
AssertThat(reader->strings_read.size(), Equals<size_t>(2));
AssertThat(reader->strings_read[1], Equals("\"key2\": 4 }"));
AssertThat(reader->strings_read[1], Equals(", \"key2\": 4 }"));
});
});
});