fix(lib): correct next sibling of zero width node
This commit is contained in:
parent
51dfe3dbdb
commit
5d1be545c4
4 changed files with 63 additions and 4 deletions
10
test/fixtures/test_grammars/next_sibling_from_zwt/corpus.txt
vendored
Normal file
10
test/fixtures/test_grammars/next_sibling_from_zwt/corpus.txt
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
===========================
|
||||
missing c node
|
||||
===========================
|
||||
|
||||
abdef
|
||||
|
||||
---
|
||||
|
||||
(source
|
||||
(MISSING "c"))
|
||||
22
test/fixtures/test_grammars/next_sibling_from_zwt/grammar.js
vendored
Normal file
22
test/fixtures/test_grammars/next_sibling_from_zwt/grammar.js
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
module.exports = grammar({
|
||||
name: "next_sibling_from_zwt",
|
||||
extras: $ => [
|
||||
/\s|\\\r?\n/,
|
||||
],
|
||||
|
||||
rules: {
|
||||
source: $ => seq(
|
||||
'a',
|
||||
$._bc,
|
||||
'd',
|
||||
'e',
|
||||
'f',
|
||||
),
|
||||
|
||||
_bc: $ => seq(
|
||||
'b',
|
||||
'c',
|
||||
),
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue