mirror of
https://github.com/pnx/tree-sitter-dotenv
synced 2026-06-16 01:54:56 +02:00
250 lines
4.5 KiB
JSON
Generated
250 lines
4.5 KiB
JSON
Generated
{
|
|
"name": "dotenv",
|
|
"rules": {
|
|
"document": {
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "comment"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "assignment"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"assignment": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "key",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "="
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_value"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"comment": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "#"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": ".*"
|
|
}
|
|
]
|
|
},
|
|
"identifier": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "[A-Za-z_][A-Za-z0-9_]*"
|
|
}
|
|
},
|
|
"_value": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string_interpolation"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "number"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "boolean"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "value"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_empty_value"
|
|
},
|
|
"named": true,
|
|
"value": "value"
|
|
}
|
|
]
|
|
},
|
|
"string": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "'"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string_content"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "'"
|
|
}
|
|
]
|
|
},
|
|
"string_interpolation": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "\""
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "string_interpolation_content"
|
|
},
|
|
"named": true,
|
|
"value": "string_content"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "\""
|
|
}
|
|
]
|
|
},
|
|
"string_content": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "[^']*"
|
|
}
|
|
},
|
|
"string_interpolation_content": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "[^\"]*"
|
|
}
|
|
},
|
|
"number": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "integer"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "float"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "hexadecimal"
|
|
}
|
|
]
|
|
},
|
|
"integer": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "(\\-)?\\d+"
|
|
}
|
|
},
|
|
"float": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "(\\-)?\\d+"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "."
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\d+"
|
|
}
|
|
]
|
|
},
|
|
"hexadecimal": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "0x"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[0-9a-fA-F]+"
|
|
}
|
|
]
|
|
},
|
|
"boolean": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "true"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "false"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"value": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": -1,
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "[^\\#\\=\\s]+"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"extras": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\s"
|
|
}
|
|
],
|
|
"conflicts": [],
|
|
"precedences": [],
|
|
"externals": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_empty_value"
|
|
}
|
|
],
|
|
"inline": [],
|
|
"supertypes": []
|
|
}
|