mirror of
https://github.com/pnx/tree-sitter-dotenv
synced 2026-08-15 12:58:12 +02:00
adding variable support
This commit is contained in:
parent
8c66bd3605
commit
7223d87d9e
5 changed files with 582 additions and 290 deletions
65
src/grammar.json
generated
65
src/grammar.json
generated
|
|
@ -62,6 +62,41 @@
|
|||
"type": "PATTERN",
|
||||
"value": "[A-Za-z_][A-Za-z0-9_]*"
|
||||
},
|
||||
"variable": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "$"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
},
|
||||
{
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "{"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "}"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"_value": {
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
|
|
@ -77,6 +112,10 @@
|
|||
"type": "SYMBOL",
|
||||
"name": "boolean"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "variable"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "value"
|
||||
|
|
@ -137,13 +176,25 @@
|
|||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "ALIAS",
|
||||
"type": "REPEAT",
|
||||
"content": {
|
||||
"type": "PATTERN",
|
||||
"value": "[^\"]+"
|
||||
},
|
||||
"named": true,
|
||||
"value": "string_content"
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "ALIAS",
|
||||
"content": {
|
||||
"type": "PATTERN",
|
||||
"value": "[^\"\\$]+"
|
||||
},
|
||||
"named": true,
|
||||
"value": "string_content"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "variable"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
|
|
@ -224,7 +275,7 @@
|
|||
},
|
||||
"value": {
|
||||
"type": "PATTERN",
|
||||
"value": "[^\\#\\s\\\"\\']+"
|
||||
"value": "[^\\#\\s\\\"\\'\\$]+"
|
||||
}
|
||||
},
|
||||
"extras": [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue