5556 lines
127 KiB
JSON
5556 lines
127 KiB
JSON
{
|
|
"$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
|
|
"name": "brolang",
|
|
"word": "identifier",
|
|
"rules": {
|
|
"source_file": {
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_top_level_declaration"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"_top_level_declaration": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "import_declaration"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "test_import_declaration"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "function_declaration"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "test_declaration"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "type_declaration"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "global_constant_declaration"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "global_variable_declaration"
|
|
}
|
|
]
|
|
},
|
|
"import_declaration": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "alias",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "::"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "import"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "path",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"test_import_declaration": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "test"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "import"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "path",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"test_declaration": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "test"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "body",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "block"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"function_declaration": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "hide"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "kind",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "func"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_func"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "parameters",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "parameter_list"
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "result",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "type"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "!"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "error",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_error_type"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "body",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "block"
|
|
}
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "body",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "block"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"type_declaration": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "hide"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "::"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "struct_type"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "c_struct_type"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "union_type"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "enum_type"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "opaque_type"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "distinct_type"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "alias_type"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"global_constant_declaration": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "hide"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "type",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "type"
|
|
}
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "::"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_value"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"global_variable_declaration": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "hide"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "type",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "type"
|
|
}
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "="
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_value"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"struct_type": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "struct"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "record_body"
|
|
}
|
|
]
|
|
},
|
|
"c_struct_type": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_struct"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "record_body"
|
|
}
|
|
]
|
|
},
|
|
"opaque_type": {
|
|
"type": "STRING",
|
|
"value": "opaque"
|
|
},
|
|
"distinct_type": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "distinct"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "type",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "type"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"alias_type": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "alias"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "type",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "type"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"union_type": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "union"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "enum"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "type"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "record_body"
|
|
}
|
|
]
|
|
},
|
|
"enum_type": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "enum"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "backing",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "type"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "enum_body"
|
|
}
|
|
]
|
|
},
|
|
"record_body": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "{"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "record_field"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "}"
|
|
}
|
|
]
|
|
},
|
|
"record_field": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "type",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "type"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "struct_type"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "="
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "default",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "type",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "type"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "struct_type"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"enum_body": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "{"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "enum_member"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "}"
|
|
}
|
|
]
|
|
},
|
|
"enum_member": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "="
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "-"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "integer"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"parameter_list": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "parameter"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "..."
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "parameter"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "..."
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
},
|
|
"parameter": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "$"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "sink"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "$"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "sink"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "type",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "type"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"type": {
|
|
"type": "PREC_LEFT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_type_atom"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "|"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_type_atom"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"_type_atom": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "builtin_type"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "intrinsic_type"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "named_type"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "optional_type"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "pointer_type"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "array_type"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "function_type"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "parenthesized_type"
|
|
}
|
|
]
|
|
},
|
|
"parenthesized_type": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "type"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
},
|
|
"named_type": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "qualified_identifier"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "argument_list"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"intrinsic_type": {
|
|
"type": "PREC",
|
|
"value": 11,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "function",
|
|
"content": {
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "struct_type!"
|
|
},
|
|
"named": true,
|
|
"value": "identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "arguments",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "argument_list"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"optional_type": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "?"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "type"
|
|
}
|
|
]
|
|
},
|
|
"pointer_type": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "@"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "*"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "mut"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "type"
|
|
}
|
|
]
|
|
},
|
|
"array_type": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "["
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "*"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ";"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "sentinel",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_type_constant"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ";"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "sentinel",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_type_constant"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "length",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "sink"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ";"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "sentinel",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_type_constant"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "]"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "mut"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "element",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "type"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"function_type": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "func"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_func"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "parameter_list"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "result",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "type"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "!"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "error",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_error_type"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"_error_type": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "type"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "enum_type"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "union_type"
|
|
}
|
|
]
|
|
},
|
|
"_type_constant": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "-"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "integer"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "character"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"builtin_type": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "void"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "noreturn"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "type"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "anyopaque"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "bool"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "int"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "uint"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "float"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "range"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "i8"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "i16"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "i32"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "i64"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "u8"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "u16"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "u32"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "u64"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "isize"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "usize"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "f32"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "f64"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_char"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_schar"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_uchar"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_short"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_ushort"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_int"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_uint"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_long"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_ulong"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_longlong"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_ulonglong"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_float"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_double"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_longdouble"
|
|
}
|
|
]
|
|
},
|
|
"block": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "{"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "statement"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "}"
|
|
}
|
|
]
|
|
},
|
|
"statement": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "constant_declaration"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "variable_declaration"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "assignment_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "return_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "yield_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "if_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "while_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "for_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "match_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "break_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "continue_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "defer_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "labeled_block"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "block"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expression_statement"
|
|
}
|
|
]
|
|
},
|
|
"constant_declaration": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "sink"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "type",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "type"
|
|
}
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "::"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_value"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"variable_declaration": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "sink"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "type",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "type"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "="
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_value"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"assignment_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "+="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "-="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "*="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "/="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "&="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "|="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "xor="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "<<="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">>="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "<<|="
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_value"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"expression_statement": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
},
|
|
"return_statement": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "return"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_value"
|
|
}
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"yield_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "yield"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "label",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_value"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"break_statement": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "break"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "label",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"continue_statement": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "continue"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "label",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"defer_statement": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "defer"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "body",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "statement"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "errdefer"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "capture",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "error_capture"
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "body",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "statement"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"error_capture": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "|"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "sink"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "|"
|
|
}
|
|
]
|
|
},
|
|
"labeled_block": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "label",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "block"
|
|
}
|
|
]
|
|
},
|
|
"if_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "if"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "condition",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "capture_list"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "consequence",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_branch_body"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "else"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "alternative",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_branch_body"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"capture_list": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "|"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "sink"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "sink"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "guard",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "|"
|
|
}
|
|
]
|
|
},
|
|
"while_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "while"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "condition",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "update",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "assignment_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expression_statement"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "assignment_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expression_statement"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "label",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "body",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_branch_body"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"for_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "expand"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "for"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "iterable",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_for_capture_bar"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "@"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "item",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "sink"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "index",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "sink"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_for_capture_bar"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "label",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "body",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "block"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"_for_capture_bar": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "|"
|
|
}
|
|
}
|
|
},
|
|
"match_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "match"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "subject",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "{"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "match_arm"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "}"
|
|
}
|
|
]
|
|
},
|
|
"match_arm": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "pattern",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "else"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "match_capture"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "body",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_branch_body"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "expand"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expand_match_capture"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "body",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_branch_body"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"match_capture": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "|"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "@"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "sink"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "|"
|
|
}
|
|
]
|
|
},
|
|
"expand_match_capture": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "|"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "@"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "sink"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "tag",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "sink"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "|"
|
|
}
|
|
]
|
|
},
|
|
"_branch_body": {
|
|
"type": "SYMBOL",
|
|
"name": "statement"
|
|
},
|
|
"_value": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "labeled_block"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "block"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "if_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "while_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "for_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "match_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
]
|
|
},
|
|
"expression": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "binary_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "catch_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "unary_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "field_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "intrinsic_call_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "call_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "index_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "slice_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "postfix_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "struct_literal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "anonymous_record_literal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "tuple_literal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "comptime_block"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "function_literal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "struct_type"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "array_type"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "enum_literal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "array_literal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "parenthesized_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "sink"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "builtin_type"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "integer"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "float"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "multiline_string"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "character"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "boolean"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "null"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "unreachable"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "undefined"
|
|
}
|
|
]
|
|
},
|
|
"binary_expression": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ".."
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "..="
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "orelse"
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 3,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "or"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 4,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "and"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 5,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "=="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "!="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "<"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "<="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">="
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 6,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "&"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "xor"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "|"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 7,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "<<"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">>"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "<<|"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 8,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "+"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "-"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 9,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "left",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "*"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "/"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "right",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"catch_expression": {
|
|
"type": "PREC_LEFT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "catch"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "capture",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "error_capture"
|
|
}
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "fallback",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "block"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "if_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "while_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "for_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "match_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"unary_expression": {
|
|
"type": "PREC",
|
|
"value": 10,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "-"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "&"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "!"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "~"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "$"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "try"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operand",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"field_expression": {
|
|
"type": "PREC_LEFT",
|
|
"value": 11,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "."
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "field",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "integer"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"intrinsic_call_expression": {
|
|
"type": "PREC",
|
|
"value": 11,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "function",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "marker",
|
|
"content": {
|
|
"type": "STRING",
|
|
"value": "!"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "arguments",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "argument_list"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"call_expression": {
|
|
"type": "PREC_LEFT",
|
|
"value": 11,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "function",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "arguments",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "argument_list"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"argument_list": {
|
|
"type": "PREC",
|
|
"value": 11,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"index_expression": {
|
|
"type": "PREC_LEFT",
|
|
"value": 11,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "["
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "index",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "]"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"slice_expression": {
|
|
"type": "PREC_LEFT",
|
|
"value": 11,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "["
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "start",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ".."
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "end",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "]"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"postfix_expression": {
|
|
"type": "PREC_LEFT",
|
|
"value": 11,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "operator",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "?"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "^"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"struct_literal": {
|
|
"type": "PREC",
|
|
"value": 11,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "type",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "qualified_identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "argument_list"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "fields",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "initializer_list"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"initializer_list": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "{"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "field_initializer"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "field_initializer"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "}"
|
|
}
|
|
]
|
|
},
|
|
"field_initializer": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_field_name"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "="
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"anonymous_record_literal": {
|
|
"type": "PREC",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "{"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "keyed_field_initializer"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "keyed_field_initializer"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"tuple_literal": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "{"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "}"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "{"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "}"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"enum_literal": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "."
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "variant_payload"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"variant_payload": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "{"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "keyed_field_initializer"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "keyed_field_initializer"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "}"
|
|
}
|
|
]
|
|
},
|
|
"keyed_field_initializer": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_field_name"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "="
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "value",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"array_literal": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "["
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "]"
|
|
}
|
|
]
|
|
},
|
|
"parenthesized_expression": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "expression"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
},
|
|
"comptime_block": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "$"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "block"
|
|
}
|
|
]
|
|
},
|
|
"function_literal": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "func"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "parameter_list"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "result",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "type"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "!"
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "error",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_error_type"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_newline"
|
|
}
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "body",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "block"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"qualified_identifier": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "FIELD",
|
|
"name": "qualifier",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "."
|
|
},
|
|
{
|
|
"type": "FIELD",
|
|
"name": "name",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"boolean": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "true"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "false"
|
|
}
|
|
]
|
|
},
|
|
"null": {
|
|
"type": "STRING",
|
|
"value": "null"
|
|
},
|
|
"unreachable": {
|
|
"type": "STRING",
|
|
"value": "unreachable"
|
|
},
|
|
"undefined": {
|
|
"type": "STRING",
|
|
"value": "undefined"
|
|
},
|
|
"sink": {
|
|
"type": "STRING",
|
|
"value": "_"
|
|
},
|
|
"_field_name": {
|
|
"type": "PREC",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "test"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "func"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_func"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "struct"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_struct"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "opaque"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "union"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "enum"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "distinct"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "alias"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "import"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "hide"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "return"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "try"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "catch"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "mut"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "null"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "unreachable"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "undefined"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "orelse"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "and"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "or"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "xor"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "if"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "while"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "for"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "expand"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "break"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "continue"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "defer"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "errdefer"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "yield"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "match"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "else"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "true"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "false"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "void"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "noreturn"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "type"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "anyopaque"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "bool"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "int"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "uint"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "float"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "range"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "i8"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "i16"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "i32"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "i64"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "u8"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "u16"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "u32"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "u64"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "isize"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "usize"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "f32"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "f64"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_char"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_schar"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_uchar"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_short"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_ushort"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_int"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_uint"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_long"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_ulong"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_longlong"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_ulonglong"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_float"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_double"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "c_longdouble"
|
|
}
|
|
]
|
|
},
|
|
"named": true,
|
|
"value": "identifier"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"identifier": {
|
|
"type": "PATTERN",
|
|
"value": "[A-Za-z_][A-Za-z0-9_]*"
|
|
},
|
|
"integer": {
|
|
"type": "PATTERN",
|
|
"value": "[0-9]+"
|
|
},
|
|
"float": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "[0-9]+\\.[0-9]+"
|
|
}
|
|
}
|
|
},
|
|
"string": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "\""
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string_content"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "escape_sequence"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "\""
|
|
}
|
|
]
|
|
},
|
|
"string_content": {
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "[^\"\\\\\\n]+"
|
|
}
|
|
}
|
|
},
|
|
"escape_sequence": {
|
|
"type": "IMMEDIATE_TOKEN",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "\\\\(?:\\\\|\"|n|r|t|0)"
|
|
}
|
|
},
|
|
"multiline_string": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "`[^\\n]*(?:\\n[ \\t]*`[^\\n]*)*"
|
|
}
|
|
},
|
|
"character": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "'(?:[^'\\\\\\n]|\\\\(?:\\\\|'|n|r|t|0))'"
|
|
}
|
|
},
|
|
"comment": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "#"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[^\\n]*"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"_newline": {
|
|
"type": "PATTERN",
|
|
"value": "\\n"
|
|
}
|
|
},
|
|
"extras": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[ \\t\\r]"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "comment"
|
|
}
|
|
],
|
|
"conflicts": [
|
|
[
|
|
"expression",
|
|
"qualified_identifier"
|
|
],
|
|
[
|
|
"constant_declaration",
|
|
"variable_declaration",
|
|
"expression"
|
|
],
|
|
[
|
|
"constant_declaration",
|
|
"variable_declaration",
|
|
"expression",
|
|
"qualified_identifier"
|
|
],
|
|
[
|
|
"function_declaration"
|
|
],
|
|
[
|
|
"if_statement"
|
|
],
|
|
[
|
|
"enum_literal"
|
|
],
|
|
[
|
|
"array_type"
|
|
],
|
|
[
|
|
"array_type",
|
|
"expression"
|
|
],
|
|
[
|
|
"array_type",
|
|
"array_literal"
|
|
],
|
|
[
|
|
"expression_statement",
|
|
"parenthesized_expression"
|
|
],
|
|
[
|
|
"assignment_statement",
|
|
"expression_statement"
|
|
],
|
|
[
|
|
"labeled_block",
|
|
"expression"
|
|
],
|
|
[
|
|
"block",
|
|
"tuple_literal",
|
|
"anonymous_record_literal"
|
|
],
|
|
[
|
|
"field_initializer",
|
|
"expression"
|
|
],
|
|
[
|
|
"capture_list",
|
|
"expression"
|
|
],
|
|
[
|
|
"match_capture",
|
|
"expression"
|
|
],
|
|
[
|
|
"statement",
|
|
"labeled_block"
|
|
]
|
|
],
|
|
"precedences": [],
|
|
"externals": [],
|
|
"inline": [],
|
|
"supertypes": [],
|
|
"reserved": {}
|
|
} |