mirror of
https://github.com/pnx/tree-sitter-dotenv
synced 2026-08-17 01:28:13 +02:00
feat: make export keyword anonymous.
"export" was a named node despite always having fixed spelling, with
no variation to expose to queries. Anonymous string literals are
already fully queryable ("export" @keyword), so the named production
added a redundant node in the tree for no benefit.
Keeps the alias("export", $.identifier) in the key field, since that
usage is a genuine reclassification (export as an identifier, not the
keyword) and still needs to be named.
Updated corpus tests to use :cst format where "export" and "="
presence needs to be asserted explicitly.
This commit is contained in:
parent
65e3328e01
commit
0cc23a517e
6 changed files with 236 additions and 250 deletions
23
src/grammar.json
generated
23
src/grammar.json
generated
|
|
@ -38,8 +38,8 @@
|
|||
{
|
||||
"type": "ALIAS",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "export"
|
||||
"type": "STRING",
|
||||
"value": "export"
|
||||
},
|
||||
"named": true,
|
||||
"value": "identifier"
|
||||
|
|
@ -80,8 +80,8 @@
|
|||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "export"
|
||||
"type": "STRING",
|
||||
"value": "export"
|
||||
},
|
||||
{
|
||||
"type": "FIELD",
|
||||
|
|
@ -96,8 +96,8 @@
|
|||
{
|
||||
"type": "ALIAS",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "export"
|
||||
"type": "STRING",
|
||||
"value": "export"
|
||||
},
|
||||
"named": true,
|
||||
"value": "identifier"
|
||||
|
|
@ -138,17 +138,6 @@
|
|||
"type": "PATTERN",
|
||||
"value": "\\#[^\\n]*"
|
||||
},
|
||||
"export": {
|
||||
"type": "TOKEN",
|
||||
"content": {
|
||||
"type": "PREC",
|
||||
"value": 1,
|
||||
"content": {
|
||||
"type": "STRING",
|
||||
"value": "export"
|
||||
}
|
||||
}
|
||||
},
|
||||
"identifier": {
|
||||
"type": "PATTERN",
|
||||
"value": "[A-Za-z_][A-Za-z0-9_]*"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue