mirror of
https://github.com/pnx/tree-sitter-dotenv
synced 2026-06-16 01:54:56 +02:00
246 lines
4.5 KiB
JSON
Generated
246 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": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_value"
|
|
}
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_end_of_assignment"
|
|
}
|
|
]
|
|
},
|
|
"comment": {
|
|
"type": "PATTERN",
|
|
"value": "\\#[^\\n]*"
|
|
},
|
|
"identifier": {
|
|
"type": "PATTERN",
|
|
"value": "[A-Za-z_][A-Za-z0-9_]*"
|
|
},
|
|
"_value": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "number"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "boolean"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "value"
|
|
}
|
|
]
|
|
},
|
|
"string": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_literal_string"
|
|
}
|
|
]
|
|
},
|
|
"_literal_string": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "'"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "[^']+"
|
|
},
|
|
"named": true,
|
|
"value": "string_content"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "'"
|
|
}
|
|
]
|
|
},
|
|
"_string": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "\""
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "[^\"]+"
|
|
},
|
|
"named": true,
|
|
"value": "string_content"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "\""
|
|
}
|
|
]
|
|
},
|
|
"number": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "integer"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "float"
|
|
}
|
|
]
|
|
},
|
|
"integer": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "decimal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "hexadecimal"
|
|
}
|
|
]
|
|
},
|
|
"decimal": {
|
|
"type": "PATTERN",
|
|
"value": "(\\-)?[1-9]\\d*"
|
|
},
|
|
"hexadecimal": {
|
|
"type": "PATTERN",
|
|
"value": "0[xX][0-9a-fA-F]+"
|
|
},
|
|
"float": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "(\\-)?[1-9]\\d*"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\.\\d+"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"boolean": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "true"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "false"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"value": {
|
|
"type": "PATTERN",
|
|
"value": "[^\\#\\s\\\"\\']+"
|
|
}
|
|
},
|
|
"extras": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\s"
|
|
}
|
|
],
|
|
"conflicts": [],
|
|
"precedences": [],
|
|
"externals": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_end_of_assignment"
|
|
}
|
|
],
|
|
"inline": [],
|
|
"supertypes": []
|
|
}
|