{
"$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
"name": "rush",
"rules": {
"program": {
"type": "CHOICE",
"members": [
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_item"
}
},
{
"type": "SEQ",
"members": [
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_statement"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "BLANK"
}
]
}
]
}
]
},
"_item": {
"type": "PREC",
"value": "item",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "function_definition"
},
{
"type": "SYMBOL",
"name": "let_stmt"
}
]
}
},
"function_definition": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "fn"
},
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "ident"
}
},
{
"type": "STRING",
"value": "("
},
{
"type": "FIELD",
"name": "params",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "parameter"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "parameter"
}
]
}
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "BLANK"
}
]
}
},
{
"type": "STRING",
"value": ")"
},
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "return_type",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "->"
},
{
"type": "SYMBOL",
"name": "type"
}
]
}
},
{
"type": "BLANK"
}
]
},
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "block"
}
}
]
},
"parameter": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "mut"
},
{
"type": "BLANK"
}
]
},
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "ident"
}
},
{
"type": "STRING",
"value": ":"
},
{
"type": "FIELD",
"name": "type",
"content": {
"type": "SYMBOL",
"name": "type"
}
}
]
},
"block": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "{"
},
{
"type": "FIELD",
"name": "stmts",
"content": {
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_statement"
}
}
},
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "expr",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "}"
}
]
},
"type": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "ident"
},
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "STRING",
"value": ")"
}
]
}
]
},
"_statement": {
"type": "PREC",
"value": "stmt",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "let_stmt"
},
{
"type": "SYMBOL",
"name": "return_stmt"
},
{
"type": "SYMBOL",
"name": "loop_stmt"
},
{
"type": "SYMBOL",
"name": "while_stmt"
},
{
"type": "SYMBOL",
"name": "for_stmt"
},
{
"type": "SYMBOL",
"name": "break_stmt"
},
{
"type": "SYMBOL",
"name": "continue_stmt"
},
{
"type": "SYMBOL",
"name": "expr_stmt"
}
]
}
},
"let_stmt": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "let"
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "mut"
},
{
"type": "BLANK"
}
]
},
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "ident"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "type",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ":"
},
{
"type": "SYMBOL",
"name": "type"
}
]
}
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "="
},
{
"type": "FIELD",
"name": "expr",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "STRING",
"value": ";"
}
]
},
"return_stmt": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "return"
},
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "expr",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ";"
}
]
},
"loop_stmt": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "loop"
},
{
"type": "FIELD",
"name": "block",
"content": {
"type": "SYMBOL",
"name": "block"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ";"
},
{
"type": "BLANK"
}
]
}
]
},
"while_stmt": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "while"
},
{
"type": "FIELD",
"name": "cond",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "block",
"content": {
"type": "SYMBOL",
"name": "block"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ";"
},
{
"type": "BLANK"
}
]
}
]
},
"for_stmt": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "for"
},
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "ident"
}
},
{
"type": "STRING",
"value": "="
},
{
"type": "FIELD",
"name": "initializer",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "STRING",
"value": ";"
},
{
"type": "FIELD",
"name": "cond",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "STRING",
"value": ";"
},
{
"type": "FIELD",
"name": "update",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "block",
"content": {
"type": "SYMBOL",
"name": "block"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ";"
},
{
"type": "BLANK"
}
]
}
]
},
"break_stmt": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "break"
},
{
"type": "STRING",
"value": ";"
}
]
},
"continue_stmt": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "continue"
},
{
"type": "STRING",
"value": ";"
}
]
},
"expr_stmt": {
"type": "PREC",
"value": "stmt",
"content": {
"type": "FIELD",
"name": "expr",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_expr_without_block"
},
{
"type": "STRING",
"value": ";"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_expr_with_block"
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ";"
},
{
"type": "BLANK"
}
]
}
]
}
]
}
}
},
"_expression": {
"type": "PREC",
"value": "expr",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_expr_without_block"
},
{
"type": "SYMBOL",
"name": "_expr_with_block"
}
]
}
},
"_expr_with_block": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "block"
},
{
"type": "SYMBOL",
"name": "if_expr"
}
]
},
"if_expr": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "if"
},
{
"type": "FIELD",
"name": "cond",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "then_block",
"content": {
"type": "SYMBOL",
"name": "block"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "else_block",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "else"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "if_expr"
},
{
"type": "SYMBOL",
"name": "block"
}
]
}
]
}
},
{
"type": "BLANK"
}
]
}
]
},
"_expr_without_block": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "int"
},
{
"type": "SYMBOL",
"name": "float"
},
{
"type": "SYMBOL",
"name": "bool"
},
{
"type": "SYMBOL",
"name": "char"
},
{
"type": "SYMBOL",
"name": "ident"
},
{
"type": "SYMBOL",
"name": "prefix_expr"
},
{
"type": "SYMBOL",
"name": "infix_expr"
},
{
"type": "SYMBOL",
"name": "assign_expr"
},
{
"type": "SYMBOL",
"name": "call_expr"
},
{
"type": "SYMBOL",
"name": "cast_expr"
},
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "STRING",
"value": ")"
}
]
}
]
},
"prefix_expr": {
"type": "PREC",
"value": "prefix",
"content": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "!"
},
{
"type": "STRING",
"value": "-"
}
]
},
{
"type": "FIELD",
"name": "expr",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
"infix_expr": {
"type": "CHOICE",
"members": [
{
"type": "PREC_LEFT",
"value": "infix_sum",
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "lhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "+"
}
},
{
"type": "FIELD",
"name": "rhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": "infix_sum",
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "lhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "-"
}
},
{
"type": "FIELD",
"name": "rhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": "infix_product",
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "lhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "*"
}
},
{
"type": "FIELD",
"name": "rhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": "infix_product",
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "lhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "/"
}
},
{
"type": "FIELD",
"name": "rhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": "infix_product",
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "lhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "%"
}
},
{
"type": "FIELD",
"name": "rhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_RIGHT",
"value": "infix_pow",
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "lhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "**"
}
},
{
"type": "FIELD",
"name": "rhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": "infix_equality",
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "lhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "=="
}
},
{
"type": "FIELD",
"name": "rhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": "infix_equality",
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "lhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "!="
}
},
{
"type": "FIELD",
"name": "rhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": "infix_relation",
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "lhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "<"
}
},
{
"type": "FIELD",
"name": "rhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": "infix_relation",
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "lhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": ">"
}
},
{
"type": "FIELD",
"name": "rhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": "infix_relation",
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "lhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "<="
}
},
{
"type": "FIELD",
"name": "rhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": "infix_relation",
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "lhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": ">="
}
},
{
"type": "FIELD",
"name": "rhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": "infix_shift",
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "lhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "<<"
}
},
{
"type": "FIELD",
"name": "rhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": "infix_shift",
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "lhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": ">>"
}
},
{
"type": "FIELD",
"name": "rhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": "bitwise_or",
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "lhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "|"
}
},
{
"type": "FIELD",
"name": "rhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": "bitwise_xor",
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "lhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "^"
}
},
{
"type": "FIELD",
"name": "rhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": "bitwise_and",
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "lhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "&"
}
},
{
"type": "FIELD",
"name": "rhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": "logical_and",
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "lhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "&&"
}
},
{
"type": "FIELD",
"name": "rhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": "logical_or",
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "lhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "||"
}
},
{
"type": "FIELD",
"name": "rhs",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
}
]
},
"assign_expr": {
"type": "PREC",
"value": "assign",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "assignee",
"content": {
"type": "SYMBOL",
"name": "ident"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "="
}
},
{
"type": "FIELD",
"name": "expr",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "assignee",
"content": {
"type": "SYMBOL",
"name": "ident"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "+="
}
},
{
"type": "FIELD",
"name": "expr",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "assignee",
"content": {
"type": "SYMBOL",
"name": "ident"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "-="
}
},
{
"type": "FIELD",
"name": "expr",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "assignee",
"content": {
"type": "SYMBOL",
"name": "ident"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "*="
}
},
{
"type": "FIELD",
"name": "expr",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "assignee",
"content": {
"type": "SYMBOL",
"name": "ident"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "/="
}
},
{
"type": "FIELD",
"name": "expr",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "assignee",
"content": {
"type": "SYMBOL",
"name": "ident"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "%="
}
},
{
"type": "FIELD",
"name": "expr",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "assignee",
"content": {
"type": "SYMBOL",
"name": "ident"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "**="
}
},
{
"type": "FIELD",
"name": "expr",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "assignee",
"content": {
"type": "SYMBOL",
"name": "ident"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "<<="
}
},
{
"type": "FIELD",
"name": "expr",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "assignee",
"content": {
"type": "SYMBOL",
"name": "ident"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": ">>="
}
},
{
"type": "FIELD",
"name": "expr",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "assignee",
"content": {
"type": "SYMBOL",
"name": "ident"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "|="
}
},
{
"type": "FIELD",
"name": "expr",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "assignee",
"content": {
"type": "SYMBOL",
"name": "ident"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "&="
}
},
{
"type": "FIELD",
"name": "expr",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "assignee",
"content": {
"type": "SYMBOL",
"name": "ident"
}
},
{
"type": "FIELD",
"name": "op",
"content": {
"type": "STRING",
"value": "^="
}
},
{
"type": "FIELD",
"name": "expr",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
]
}
},
"call_expr": {
"type": "PREC",
"value": "call",
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "func",
"content": {
"type": "SYMBOL",
"name": "ident"
}
},
{
"type": "STRING",
"value": "("
},
{
"type": "FIELD",
"name": "args",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "_expression"
}
]
}
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "BLANK"
}
]
}
},
{
"type": "STRING",
"value": ")"
}
]
}
},
"cast_expr": {
"type": "PREC",
"value": "cast",
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "STRING",
"value": "as"
},
{
"type": "SYMBOL",
"name": "type"
}
]
}
},
"ident": {
"type": "PATTERN",
"value": "[a-zA-Z_][a-zA-Z_0-9]*"
},
"int": {
"type": "PATTERN",
"value": "[0-9][0-9_]*|0x[0-9A-Fa-f][0-9A-Fa-f_]*"
},
"float": {
"type": "PATTERN",
"value": "[0-9][0-9_]*(\\.[0-9][0-9_]*|f)"
},
"char": {
"type": "TOKEN",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "'"
},
{
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "\\"
},
{
"type": "CHOICE",
"members": [
{
"type": "PATTERN",
"value": "[\\\\bnrt']"
},
{
"type": "PATTERN",
"value": "x[0-9a-fA-F]{2}"
}
]
}
]
},
{
"type": "PATTERN",
"value": "[^\\\\']"
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "'"
}
]
}
},
"bool": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "true"
},
{
"type": "STRING",
"value": "false"
}
]
},
"line_comment": {
"type": "PATTERN",
"value": "\\/\\/.*"
},
"block_comment": {
"type": "TOKEN",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "/*"
},
{
"type": "PATTERN",
"value": "[^*]*\\*+([^/*][^*]*\\*+)*"
},
{
"type": "STRING",
"value": "/"
}
]
}
}
},
"extras": [
{
"type": "PATTERN",
"value": " |\\n|\\t|\\r"
},
{
"type": "SYMBOL",
"name": "line_comment"
},
{
"type": "SYMBOL",
"name": "block_comment"
}
],
"conflicts": [],
"precedences": [
[
{
"type": "STRING",
"value": "call"
},
{
"type": "STRING",
"value": "prefix"
},
{
"type": "STRING",
"value": "infix_pow"
},
{
"type": "STRING",
"value": "cast"
},
{
"type": "STRING",
"value": "infix_product"
},
{
"type": "STRING",
"value": "infix_sum"
},
{
"type": "STRING",
"value": "infix_shift"
},
{
"type": "STRING",
"value": "infix_relation"
},
{
"type": "STRING",
"value": "infix_equality"
},
{
"type": "STRING",
"value": "bitwise_and"
},
{
"type": "STRING",
"value": "bitwise_xor"
},
{
"type": "STRING",
"value": "bitwise_or"
},
{
"type": "STRING",
"value": "logical_and"
},
{
"type": "STRING",
"value": "logical_or"
},
{
"type": "STRING",
"value": "assign"
}
],
[
{
"type": "STRING",
"value": "expr"
},
{
"type": "STRING",
"value": "stmt"
}
],
[
{
"type": "STRING",
"value": "item"
},
{
"type": "STRING",
"value": "stmt"
}
]
],
"externals": [],
"inline": [],
"supertypes": [],
"reserved": {}
}