tree-sitter-bp/src/grammar.json

84 lines
1.5 KiB
JSON
Raw Normal View History

2024-04-07 20:59:34 +02:00
{
"name": "blueprint",
"rules": {
"source_file": {
2024-04-07 22:37:52 +02:00
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_definition"
}
},
"_definition": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "assignment"
}
]
},
"assignment": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "identifier"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "="
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_expr"
}
}
]
},
"_expr": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SYMBOL",
"name": "integer_literal"
}
]
},
"identifier": {
"type": "PATTERN",
"value": "[_\\p{XID_Start}][_\\p{XID_Continue}]*"
},
"integer_literal": {
"type": "PATTERN",
"value": "[0-9]+"
2024-04-07 20:59:34 +02:00
}
},
"extras": [
{
"type": "PATTERN",
2024-04-07 22:37:52 +02:00
"value": "\\s+"
2024-04-07 20:59:34 +02:00
}
],
"conflicts": [],
"precedences": [],
"externals": [],
"inline": [],
"supertypes": []
}