fix(wasm): Fix predicates in alternations, resolves #1392
This commit is contained in:
parent
b324d0802a
commit
79b2bf1c30
1 changed files with 3 additions and 2 deletions
|
|
@ -785,6 +785,7 @@ class Language {
|
|||
if (c.name === captureName1) node1 = c.node;
|
||||
if (c.name === captureName2) node2 = c.node;
|
||||
}
|
||||
if(node1 === undefined || node2 === undefined) return true;
|
||||
return (node1.text === node2.text) === isPositive;
|
||||
});
|
||||
} else {
|
||||
|
|
@ -796,7 +797,7 @@ class Language {
|
|||
return (c.node.text === stringValue) === isPositive;
|
||||
};
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
|
@ -819,7 +820,7 @@ class Language {
|
|||
for (const c of captures) {
|
||||
if (c.name === captureName) return regex.test(c.node.text) === isPositive;
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
});
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue