forked from hinterland/hearth
197 lines
3.6 KiB
JSON
Generated
197 lines
3.6 KiB
JSON
Generated
{
|
|
"$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
|
|
"name": "hemar",
|
|
"rules": {
|
|
"source_file": {
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "element"
|
|
}
|
|
},
|
|
"element": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "interpolation"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "segment"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "text"
|
|
}
|
|
]
|
|
},
|
|
"interpolation": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "{["
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "path"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "]}"
|
|
}
|
|
]
|
|
},
|
|
"segment": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "for"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "element"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "done"
|
|
}
|
|
]
|
|
},
|
|
"for": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "{["
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "for"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "in"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "path"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "]}"
|
|
}
|
|
]
|
|
},
|
|
"done": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "{["
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "done"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "]}"
|
|
}
|
|
]
|
|
},
|
|
"path": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "."
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "."
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"string": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": -1,
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "[^] .\\\\\"]+"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": -1,
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "\"([^\"]|\"\")*\""
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"text": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": -1,
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "(?:\\{[^\\[]|[^{])+"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"extras": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\s"
|
|
}
|
|
],
|
|
"conflicts": [],
|
|
"precedences": [],
|
|
"externals": [],
|
|
"inline": [],
|
|
"supertypes": [],
|
|
"reserved": {}
|
|
} |