Symbols without aliases should be used for lookahead
This commit is contained in:
parent
7267384970
commit
1f52f2f1dc
9 changed files with 115 additions and 7 deletions
|
|
@ -327,7 +327,7 @@ describe("Node", () => {
|
|||
});
|
||||
|
||||
describe(".parseState", () => {
|
||||
const text = "10 * 5";
|
||||
const text = "10 / 5";
|
||||
|
||||
it(`returns node parse state ids`, async () => {
|
||||
tree = await parser.parse(text)
|
||||
|
|
@ -335,9 +335,13 @@ describe("Node", () => {
|
|||
const [numerator, slash, denominator] = quotientNode.children;
|
||||
|
||||
assert.equal(tree.rootNode.parseState, 0);
|
||||
assert.equal(numerator.parseState, 1);
|
||||
assert.equal(slash.parseState, 553);
|
||||
assert.equal(denominator.parseState, 185);
|
||||
// parse states will change on any change to the grammar so test that it
|
||||
// returns something instead
|
||||
assert.isAbove(numerator.parseState, 0);
|
||||
assert.isAbove(numerator.nextParseState, 0);
|
||||
assert.isAbove(slash.parseState, 0);
|
||||
assert.isAbove(denominator.parseState, 0);
|
||||
assert.isAbove(denominator.nextParseState, 0);
|
||||
})
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue