Delete parser and iterator
This commit is contained in:
parent
4d6a30a69e
commit
e2c2e39e15
1 changed files with 7 additions and 2 deletions
|
|
@ -51,14 +51,19 @@ describe("Lookahead iterator", () => {
|
|||
({ JavaScript, Parser } = await require("./helper"));
|
||||
const parser = new Parser().setLanguage(JavaScript);
|
||||
const tree = parser.parse("function fn() {}");
|
||||
parser.delete();
|
||||
const cursor = tree.walk();
|
||||
cursor.gotoFirstChild();
|
||||
cursor.gotoFirstChild();
|
||||
assert(cursor.gotoFirstChild());
|
||||
assert(cursor.gotoFirstChild());
|
||||
state = cursor.currentNode().nextParseState;
|
||||
lookahead = JavaScript.lookaheadIterator(state);
|
||||
assert.exists(lookahead);
|
||||
});
|
||||
|
||||
after(() => {
|
||||
lookahead.delete();
|
||||
});
|
||||
|
||||
const expected = ["identifier", "comment", "(", "*", "formal_parameters"];
|
||||
it("should iterate over valid symbols in the state", () => {
|
||||
const symbols = Array.from(lookahead);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue