tree-sitter/test/fixtures/test_grammars/aliased_unit_reductions/grammar.json

81 lines
1.4 KiB
JSON

{
"name": "aliased_unit_reductions",
"extras": [
{"type": "PATTERN", "value": "\\s"}
],
"rules": {
"statement": {
"type": "SEQ",
"members": [
{"type": "SYMBOL", "name": "_a"},
// The `_b` rule is always aliased to `b_prime`, so it is internally treated
// as a simple alias.
{
"type": "ALIAS",
"named": true,
"value": "b_prime",
"content": {
"type": "SYMBOL",
"name": "_b"
}
},
// The `_c` rule is used without an alias in addition to being aliased to `c_prime`,
// so it is not a simple alias.
{
"type": "ALIAS",
"named": true,
"value": "c_prime",
"content": {
"type": "SYMBOL",
"name": "_c"
}
},
{
"type": "SYMBOL",
"name": "_c"
},
{
"type": "STRING",
"value": ";"
}
]
},
"_a": {
"type": "SYMBOL",
"name": "_A"
},
"_A": {
"type": "SYMBOL",
"name": "identifier"
},
"_b": {
"type": "SYMBOL",
"name": "_B"
},
"_B": {
"type": "SYMBOL",
"name": "identifier"
},
"_c": {
"type": "SYMBOL",
"name": "_C"
},
"_C": {
"type": "SYMBOL",
"name": "identifier"
},
"identifier": {"type": "PATTERN", "value": "[a-z]+"}
}
}