fix(lib): check if an ERROR node is named before assuming it's the builtin error node
(cherry picked from commit b7f36a13ba)
This commit is contained in:
parent
1083795af6
commit
22fa144016
4 changed files with 47 additions and 2 deletions
9
test/fixtures/test_grammars/anonymous_error/corpus.txt
vendored
Normal file
9
test/fixtures/test_grammars/anonymous_error/corpus.txt
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
======================
|
||||
A simple error literal
|
||||
======================
|
||||
|
||||
ERROR
|
||||
|
||||
---
|
||||
|
||||
(document)
|
||||
6
test/fixtures/test_grammars/anonymous_error/grammar.js
vendored
Normal file
6
test/fixtures/test_grammars/anonymous_error/grammar.js
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
module.exports = grammar({
|
||||
name: 'anonymous_error',
|
||||
rules: {
|
||||
document: $ => repeat(choice('ok', 'ERROR')),
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue