mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-30 14:17:02 +00:00
208 lines
3.9 KiB
JSON
208 lines
3.9 KiB
JSON
{
|
|
"name": "context_predicate",
|
|
"rules": {
|
|
"source": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
"_expression": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "not"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "and"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "or"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "equal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "not_equal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "parenthesized"
|
|
}
|
|
]
|
|
},
|
|
"identifier": {
|
|
"type": "PATTERN",
|
|
"value": "[A-Za-z0-9_-]+"
|
|
},
|
|
"not": {
|
|
"type": "PREC",
|
|
"value": 3,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "!"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "expression",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"and": {
|
|
"type": "PREC_LEFT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "&&"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"or": {
|
|
"type": "PREC_LEFT",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "||"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"equal": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "=="
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"not_equal": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "!="
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"parenthesized": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "expression",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"extras": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\s"
|
|
}
|
|
],
|
|
"conflicts": [],
|
|
"precedences": [],
|
|
"externals": [],
|
|
"inline": [],
|
|
"supertypes": []
|
|
}
|
|
|