feat(package): hemar: tree sitter grammar
This commit is contained in:
197
package/hemar/grammar/tree-sitter/src/grammar.json
generated
Normal file
197
package/hemar/grammar/tree-sitter/src/grammar.json
generated
Normal file
@@ -0,0 +1,197 @@
|
||||
{
|
||||
"$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
|
||||
"name": "mytempl",
|
||||
"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": {}
|
||||
}
|
||||
Reference in New Issue
Block a user