@bablr/bablr-vm 0.23.0 → 0.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/match.js +15 -4
- package/package.json +1 -1
package/lib/match.js
CHANGED
|
@@ -679,9 +679,18 @@ export class Match extends WeakStackFrame {
|
|
|
679
679
|
let finishedMatch = m;
|
|
680
680
|
m = m.parent;
|
|
681
681
|
|
|
682
|
-
let
|
|
683
|
-
|
|
684
|
-
|
|
682
|
+
let parentRoot = Path.from(m.rootNode);
|
|
683
|
+
|
|
684
|
+
if (m.type !== '__') {
|
|
685
|
+
parentRoot = parentRoot.tagPathAt(getCloseTag(m.rootNode) ? -2 : -1).inner;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
let finishedChildren =
|
|
689
|
+
finishedMatch.type !== '__' ? 1 : Tags.getSize(finishedMatch.rootNode.value.children);
|
|
690
|
+
|
|
691
|
+
let parentNextTagPath = parentRoot?.tagPathAt(
|
|
692
|
+
finishedMatch.parentPreviousTagPath.tagsIndex + finishedChildren + 1,
|
|
693
|
+
);
|
|
685
694
|
|
|
686
695
|
tagPath = parentNextTagPath;
|
|
687
696
|
|
|
@@ -750,7 +759,9 @@ export class Match extends WeakStackFrame {
|
|
|
750
759
|
do {
|
|
751
760
|
if (m.running) {
|
|
752
761
|
m = m.running;
|
|
753
|
-
|
|
762
|
+
// TODO is -1 ok
|
|
763
|
+
let shiftIndex = m.didShift ? -1 : 0;
|
|
764
|
+
tagPath = TagPath.fromNode(m.rootNode, shiftIndex);
|
|
754
765
|
} else if (m.parent && (!m.parent.running || m.parent.running !== m)) {
|
|
755
766
|
tagPath = m.parentPreviousTagPath;
|
|
756
767
|
|