web: Implement TreeCursor.nodeText

Refs #466
This commit is contained in:
Max Brunsfeld 2019-10-22 12:58:27 -07:00
parent 80008b0bcc
commit f736cb3896
2 changed files with 30 additions and 17 deletions

View file

@ -180,6 +180,7 @@ describe("Tree", () => {
});
assert(cursor.gotoFirstChild());
assert.equal(cursor.nodeText, 'a');
assertCursorState(cursor, {
nodeType: 'identifier',
nodeIsNamed: true,
@ -191,6 +192,7 @@ describe("Tree", () => {
assert(!cursor.gotoFirstChild())
assert(cursor.gotoNextSibling());
assert.equal(cursor.nodeText, '*');
assertCursorState(cursor, {
nodeType: '*',
nodeIsNamed: false,
@ -201,6 +203,7 @@ describe("Tree", () => {
});
assert(cursor.gotoNextSibling());
assert.equal(cursor.nodeText, 'b');
assertCursorState(cursor, {
nodeType: 'identifier',
nodeIsNamed: true,