Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
{
"name": "ruby",
"word": "identifier",
"rules": {
"program": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_statements"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "__END__"
},
{
"type": "SYMBOL",
"name": "_line_break"
},
{
"type": "SYMBOL",
"name": "uninterpreted"
}
]
},
{
"type": "BLANK"
}
]
}
]
},
"uninterpreted": {
"type": "PATTERN",
"value": "(.|\\s)*"
},
"_statements": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "REPEAT1",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_statement"
},
{
"type": "SYMBOL",
"name": "_terminator"
}
]
},
{
"type": "SYMBOL",
"name": "empty_statement"
}
]
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_statement"
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "SYMBOL",
"name": "_statement"
}
]
},
"begin_block": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "BEGIN"
},
{
"type": "STRING",
"value": "{"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_statements"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "}"
}
]
},
"end_block": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "END"
},
{
"type": "STRING",
"value": "{"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_statements"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "}"
}
]
},
"_statement": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "undef"
},
{
"type": "SYMBOL",
"name": "alias"
},
{
"type": "SYMBOL",
"name": "if_modifier"
},
{
"type": "SYMBOL",
"name": "unless_modifier"
},
{
"type": "SYMBOL",
"name": "while_modifier"
},
{
"type": "SYMBOL",
"name": "until_modifier"
},
{
"type": "SYMBOL",
"name": "rescue_modifier"
},
{
"type": "SYMBOL",
"name": "begin_block"
},
{
"type": "SYMBOL",
"name": "end_block"
},
{
"type": "SYMBOL",
"name": "_expression"
}
]
},
"method": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "def"
},
{
"type": "SYMBOL",
"name": "_method_rest"
}
]
},
"singleton_method": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "def"
},
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "object",
"content": {
"type": "SYMBOL",
"name": "_variable"
}
},
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "FIELD",
"name": "object",
"content": {
"type": "SYMBOL",
"name": "_arg"
}
},
{
"type": "STRING",
"value": ")"
}
]
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "."
},
{
"type": "STRING",
"value": "::"
}
]
}
]
},
{
"type": "SYMBOL",
"name": "_method_rest"
}
]
},
"_method_rest": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "_method_name"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_body_expr"
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "parameters",
"content": {
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "parameters"
},
"named": true,
"value": "method_parameters"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_terminator"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "_body_statement"
}
]
},
{
"type": "SYMBOL",
"name": "_body_expr"
}
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "parameters",
"content": {
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "bare_parameters"
},
"named": true,
"value": "method_parameters"
}
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "_terminator"
},
{
"type": "SYMBOL",
"name": "_body_statement"
}
]
}
]
}
]
},
"rescue_modifier_arg": {
"type": "PREC",
"value": 16,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "_arg"
}
},
{
"type": "STRING",
"value": "rescue"
},
{
"type": "FIELD",
"name": "handler",
"content": {
"type": "SYMBOL",
"name": "_arg"
}
}
]
}
},
"rescue_modifier_expression": {
"type": "PREC",
"value": 16,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "STRING",
"value": "rescue"
},
{
"type": "FIELD",
"name": "handler",
"content": {
"type": "SYMBOL",
"name": "_arg"
}
}
]
}
},
"_body_expr": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "="
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_arg"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "rescue_modifier_arg"
},
"named": true,
"value": "rescue_modifier"
}
]
}
]
},
"parameters": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_formal_parameter"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "_formal_parameter"
}
]
}
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ")"
}
]
},
"bare_parameters": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_simple_formal_parameter"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "_formal_parameter"
}
]
}
}
]
},
"block_parameters": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "|"
},
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_formal_parameter"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "_formal_parameter"
}
]
}
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ";"
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "locals",
"content": {
"type": "SYMBOL",
"name": "identifier"
}
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "FIELD",
"name": "locals",
"content": {
"type": "SYMBOL",
"name": "identifier"
}
}
]
}
}
]
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "|"
}
]
},
"_formal_parameter": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_simple_formal_parameter"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "parameters"
},
"named": true,
"value": "destructured_parameter"
}
]
},
"_simple_formal_parameter": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SYMBOL",
"name": "splat_parameter"
},
{
"type": "SYMBOL",
"name": "hash_splat_parameter"
},
{
"type": "SYMBOL",
"name": "hash_splat_nil"
},
{
"type": "SYMBOL",
"name": "forward_parameter"
},
{
"type": "SYMBOL",
"name": "block_parameter"
},
{
"type": "SYMBOL",
"name": "keyword_parameter"
},
{
"type": "SYMBOL",
"name": "optional_parameter"
}
]
},
"forward_parameter": {
"type": "STRING",
"value": "..."
},
"splat_parameter": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "*"
},
{
"type": "FIELD",
"name": "name",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "BLANK"
}
]
}
}
]
},
"hash_splat_parameter": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "**"
},
{
"type": "FIELD",
"name": "name",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "BLANK"
}
]
}
}
]
},
"hash_splat_nil": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "**"
},
{
"type": "STRING",
"value": "nil"
}
]
},
"block_parameter": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "&"
},
{
"type": "FIELD",
"name": "name",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "BLANK"
}
]
}
}
]
},
"keyword_parameter": {
"type": "PREC_RIGHT",
"value": 51,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "identifier"
}
},
{
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "STRING",
"value": ":"
}
},
{
"type": "FIELD",
"name": "value",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_arg"
},
{
"type": "BLANK"
}
]
}
}
]
}
},
"optional_parameter": {
"type": "PREC",
"value": 51,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "identifier"
}
},
{
"type": "STRING",
"value": "="
},
{
"type": "FIELD",
"name": "value",
"content": {
"type": "SYMBOL",
"name": "_arg"
}
}
]
}
},
"class": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "class"
},
{
"type": "FIELD",
"name": "name",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "constant"
},
{
"type": "SYMBOL",
"name": "scope_resolution"
}
]
}
},
{
"type": "FIELD",
"name": "superclass",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "superclass"
},
{
"type": "BLANK"
}
]
}
},
{
"type": "SYMBOL",
"name": "_terminator"
},
{
"type": "SYMBOL",
"name": "_body_statement"
}
]
},
"superclass": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "<"
},
{
"type": "SYMBOL",
"name": "_expression"
}
]
},
"singleton_class": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "class"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_singleton_class_left_angle_left_langle"
},
"named": false,
"value": "<<"
},
{
"type": "FIELD",
"name": "value",
"content": {
"type": "SYMBOL",
"name": "_arg"
}
},
{
"type": "SYMBOL",
"name": "_terminator"
},
{
"type": "SYMBOL",
"name": "_body_statement"
}
]
},
"module": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "module"
},
{
"type": "FIELD",
"name": "name",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "constant"
},
{
"type": "SYMBOL",
"name": "scope_resolution"
}
]
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_terminator"
},
{
"type": "SYMBOL",
"name": "_body_statement"
}
]
},
{
"type": "STRING",
"value": "end"
}
]
}
]
},
"return_command": {
"type": "PREC_LEFT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "return"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "command_argument_list"
},
"named": true,
"value": "argument_list"
}
]
}
},
"yield_command": {
"type": "PREC_LEFT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "yield"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "command_argument_list"
},
"named": true,
"value": "argument_list"
}
]
}
},
"break_command": {
"type": "PREC_LEFT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "break"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "command_argument_list"
},
"named": true,
"value": "argument_list"
}
]
}
},
"next_command": {
"type": "PREC_LEFT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "next"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "command_argument_list"
},
"named": true,
"value": "argument_list"
}
]
}
},
"return": {
"type": "PREC_LEFT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "return"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "argument_list"
},
{
"type": "BLANK"
}
]
}
]
}
},
"yield": {
"type": "PREC_LEFT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "yield"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "argument_list"
},
{
"type": "BLANK"
}
]
}
]
}
},
"break": {
"type": "PREC_LEFT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "break"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "argument_list"
},
{
"type": "BLANK"
}
]
}
]
}
},
"next": {
"type": "PREC_LEFT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "next"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "argument_list"
},
{
"type": "BLANK"
}
]
}
]
}
},
"redo": {
"type": "PREC_LEFT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "redo"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "argument_list"
},
{
"type": "BLANK"
}
]
}
]
}
},
"retry": {
"type": "PREC_LEFT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "retry"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "argument_list"
},
{
"type": "BLANK"
}
]
}
]
}
},
"if_modifier": {
"type": "PREC",
"value": 16,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "_statement"
}
},
{
"type": "STRING",
"value": "if"
},
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
"unless_modifier": {
"type": "PREC",
"value": 16,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "_statement"
}
},
{
"type": "STRING",
"value": "unless"
},
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
"while_modifier": {
"type": "PREC",
"value": 16,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "_statement"
}
},
{
"type": "STRING",
"value": "while"
},
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
"until_modifier": {
"type": "PREC",
"value": 16,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "_statement"
}
},
{
"type": "STRING",
"value": "until"
},
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
"rescue_modifier": {
"type": "PREC",
"value": 16,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "_statement"
}
},
{
"type": "STRING",
"value": "rescue"
},
{
"type": "FIELD",
"name": "handler",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
"while": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "while"
},
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "SYMBOL",
"name": "_statement"
}
},
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "do"
}
}
]
},
"until": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "until"
},
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "SYMBOL",
"name": "_statement"
}
},
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "do"
}
}
]
},
"for": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "for"
},
{
"type": "FIELD",
"name": "pattern",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_lhs"
},
{
"type": "SYMBOL",
"name": "left_assignment_list"
}
]
}
},
{
"type": "FIELD",
"name": "value",
"content": {
"type": "SYMBOL",
"name": "in"
}
},
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "do"
}
}
]
},
"in": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "in"
},
{
"type": "SYMBOL",
"name": "_arg"
}
]
},
"do": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "do"
},
{
"type": "SYMBOL",
"name": "_terminator"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_statements"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "end"
}
]
},
"case": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "case"
},
{
"type": "FIELD",
"name": "value",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_statement"
},
{
"type": "BLANK"
}
]
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_terminator"
},
{
"type": "BLANK"
}
]
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "when"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "else"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "end"
}
]
},
"case_match": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "case"
},
{
"type": "FIELD",
"name": "value",
"content": {
"type": "SYMBOL",
"name": "_statement"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_terminator"
},
{
"type": "BLANK"
}
]
},
{
"type": "REPEAT1",
"content": {
"type": "FIELD",
"name": "clauses",
"content": {
"type": "SYMBOL",
"name": "in_clause"
}
}
},
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "else",
"content": {
"type": "SYMBOL",
"name": "else"
}
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "end"
}
]
},
"when": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "when"
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "pattern",
"content": {
"type": "SYMBOL",
"name": "pattern"
}
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "FIELD",
"name": "pattern",
"content": {
"type": "SYMBOL",
"name": "pattern"
}
}
]
}
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_terminator"
},
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "then"
}
}
]
}
]
},
"in_clause": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "in"
},
{
"type": "FIELD",
"name": "pattern",
"content": {
"type": "SYMBOL",
"name": "_pattern_top_expr_body"
}
},
{
"type": "FIELD",
"name": "guard",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_guard"
},
{
"type": "BLANK"
}
]
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_terminator"
},
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "then"
}
}
]
}
]
},
"pattern": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_arg"
},
{
"type": "SYMBOL",
"name": "splat_argument"
}
]
},
"_guard": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "if_guard"
},
{
"type": "SYMBOL",
"name": "unless_guard"
}
]
},
"if_guard": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "if"
},
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
},
"unless_guard": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "unless"
},
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
},
"_pattern_top_expr_body": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_pattern_expr"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_array_pattern_n"
},
"named": true,
"value": "array_pattern"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_find_pattern_body"
},
"named": true,
"value": "find_pattern"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_hash_pattern_body"
},
"named": true,
"value": "hash_pattern"
}
]
},
"_array_pattern_n": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_pattern_expr"
},
{
"type": "ALIAS",
"content": {
"type": "STRING",
"value": ","
},
"named": true,
"value": "splat_parameter"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_pattern_expr"
},
{
"type": "STRING",
"value": ","
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_pattern_expr"
},
{
"type": "SYMBOL",
"name": "_array_pattern_n"
}
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "splat_parameter"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "_pattern_expr"
}
]
}
}
]
}
]
},
"_pattern_expr": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "as_pattern"
},
{
"type": "SYMBOL",
"name": "_pattern_expr_alt"
}
]
},
"as_pattern": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "value",
"content": {
"type": "SYMBOL",
"name": "_pattern_expr"
}
},
{
"type": "STRING",
"value": "=>"
},
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "identifier"
}
}
]
},
"_pattern_expr_alt": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "alternative_pattern"
},
{
"type": "SYMBOL",
"name": "_pattern_expr_basic"
}
]
},
"alternative_pattern": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "alternatives",
"content": {
"type": "SYMBOL",
"name": "_pattern_expr_basic"
}
},
{
"type": "REPEAT1",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "|"
},
{
"type": "FIELD",
"name": "alternatives",
"content": {
"type": "SYMBOL",
"name": "_pattern_expr_basic"
}
}
]
}
}
]
},
"_array_pattern_body": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_pattern_expr"
},
{
"type": "SYMBOL",
"name": "_array_pattern_n"
}
]
},
"array_pattern": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "["
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_array_pattern_body"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "]"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "class",
"content": {
"type": "SYMBOL",
"name": "_pattern_constant"
}
},
{
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "STRING",
"value": "["
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_array_pattern_body"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "]"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "class",
"content": {
"type": "SYMBOL",
"name": "_pattern_constant"
}
},
{
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "STRING",
"value": "("
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_array_pattern_body"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ")"
}
]
}
]
},
"_find_pattern_body": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "splat_parameter"
},
{
"type": "REPEAT1",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "_pattern_expr"
}
]
}
},
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "splat_parameter"
}
]
},
"find_pattern": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "["
},
{
"type": "SYMBOL",
"name": "_find_pattern_body"
},
{
"type": "STRING",
"value": "]"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "class",
"content": {
"type": "SYMBOL",
"name": "_pattern_constant"
}
},
{
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "STRING",
"value": "["
}
},
{
"type": "SYMBOL",
"name": "_find_pattern_body"
},
{
"type": "STRING",
"value": "]"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "class",
"content": {
"type": "SYMBOL",
"name": "_pattern_constant"
}
},
{
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "STRING",
"value": "("
}
},
{
"type": "SYMBOL",
"name": "_find_pattern_body"
},
{
"type": "STRING",
"value": ")"
}
]
}
]
},
"_hash_pattern_body": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "keyword_pattern"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "keyword_pattern"
}
]
}
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "keyword_pattern"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "keyword_pattern"
}
]
}
}
]
},
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "_hash_pattern_any_rest"
}
]
},
{
"type": "SYMBOL",
"name": "_hash_pattern_any_rest"
}
]
},
"keyword_pattern": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "key",
"content": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "identifier"
},
"named": true,
"value": "hash_key_symbol"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "constant"
},
"named": true,
"value": "hash_key_symbol"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "identifier_suffix"
},
"named": true,
"value": "hash_key_symbol"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "constant_suffix"
},
"named": true,
"value": "hash_key_symbol"
},
{
"type": "SYMBOL",
"name": "string"
}
]
}
},
{
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "STRING",
"value": ":"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "value",
"content": {
"type": "SYMBOL",
"name": "_pattern_expr"
}
},
{
"type": "BLANK"
}
]
}
]
},
"_hash_pattern_any_rest": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "hash_splat_parameter"
},
{
"type": "SYMBOL",
"name": "hash_splat_nil"
}
]
},
"hash_pattern": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "{"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_hash_pattern_body"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "}"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "class",
"content": {
"type": "SYMBOL",
"name": "_pattern_constant"
}
},
{
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "STRING",
"value": "["
}
},
{
"type": "SYMBOL",
"name": "_hash_pattern_body"
},
{
"type": "STRING",
"value": "]"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "class",
"content": {
"type": "SYMBOL",
"name": "_pattern_constant"
}
},
{
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "STRING",
"value": "("
}
},
{
"type": "SYMBOL",
"name": "_hash_pattern_body"
},
{
"type": "STRING",
"value": ")"
}
]
}
]
},
"_pattern_expr_basic": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_pattern_value"
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SYMBOL",
"name": "array_pattern"
},
{
"type": "SYMBOL",
"name": "find_pattern"
},
{
"type": "SYMBOL",
"name": "hash_pattern"
},
{
"type": "SYMBOL",
"name": "parenthesized_pattern"
}
]
},
"parenthesized_pattern": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "SYMBOL",
"name": "_pattern_expr"
},
{
"type": "STRING",
"value": ")"
}
]
},
"_pattern_value": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_pattern_primitive"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_pattern_range"
},
"named": true,
"value": "range"
},
{
"type": "SYMBOL",
"name": "variable_reference_pattern"
},
{
"type": "SYMBOL",
"name": "expression_reference_pattern"
},
{
"type": "SYMBOL",
"name": "_pattern_constant"
}
]
},
"_pattern_range": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "begin",
"content": {
"type": "SYMBOL",
"name": "_pattern_primitive"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ".."
},
{
"type": "STRING",
"value": "..."
}
]
}
},
{
"type": "FIELD",
"name": "end",
"content": {
"type": "SYMBOL",
"name": "_pattern_primitive"
}
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ".."
},
{
"type": "STRING",
"value": "..."
}
]
}
},
{
"type": "FIELD",
"name": "end",
"content": {
"type": "SYMBOL",
"name": "_pattern_primitive"
}
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "begin",
"content": {
"type": "SYMBOL",
"name": "_pattern_primitive"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ".."
},
{
"type": "STRING",
"value": "..."
}
]
}
}
]
}
]
},
"_pattern_primitive": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_pattern_literal"
},
{
"type": "SYMBOL",
"name": "_pattern_lambda"
}
]
},
"_pattern_lambda": {
"type": "SYMBOL",
"name": "lambda"
},
"_pattern_literal": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_literal"
},
{
"type": "SYMBOL",
"name": "string"
},
{
"type": "SYMBOL",
"name": "subshell"
},
{
"type": "SYMBOL",
"name": "heredoc_beginning"
},
{
"type": "SYMBOL",
"name": "regex"
},
{
"type": "SYMBOL",
"name": "string_array"
},
{
"type": "SYMBOL",
"name": "symbol_array"
},
{
"type": "SYMBOL",
"name": "_keyword_variable"
}
]
},
"_keyword_variable": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "nil"
},
{
"type": "SYMBOL",
"name": "self"
},
{
"type": "SYMBOL",
"name": "true"
},
{
"type": "SYMBOL",
"name": "false"
},
{
"type": "SYMBOL",
"name": "line"
},
{
"type": "SYMBOL",
"name": "file"
},
{
"type": "SYMBOL",
"name": "encoding"
}
]
},
"line": {
"type": "STRING",
"value": "__LINE__"
},
"file": {
"type": "STRING",
"value": "__FILE__"
},
"encoding": {
"type": "STRING",
"value": "__ENCODING__"
},
"variable_reference_pattern": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "^"
},
{
"type": "FIELD",
"name": "name",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SYMBOL",
"name": "_nonlocal_variable"
}
]
}
}
]
},
"expression_reference_pattern": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "^"
},
{
"type": "STRING",
"value": "("
},
{
"type": "FIELD",
"name": "value",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "STRING",
"value": ")"
}
]
},
"_pattern_constant": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "constant"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_pattern_constant_resolution"
},
"named": true,
"value": "scope_resolution"
}
]
},
"_pattern_constant_resolution": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "scope",
"content": {
"type": "SYMBOL",
"name": "_pattern_constant"
}
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "::"
},
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "constant"
}
}
]
},
"if": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "if"
},
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "SYMBOL",
"name": "_statement"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_terminator"
},
{
"type": "FIELD",
"name": "consequence",
"content": {
"type": "SYMBOL",
"name": "then"
}
}
]
},
{
"type": "FIELD",
"name": "alternative",
"content": {
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "else"
},
{
"type": "SYMBOL",
"name": "elsif"
}
]
},
{
"type": "BLANK"
}
]
}
},
{
"type": "STRING",
"value": "end"
}
]
},
"unless": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "unless"
},
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "SYMBOL",
"name": "_statement"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_terminator"
},
{
"type": "FIELD",
"name": "consequence",
"content": {
"type": "SYMBOL",
"name": "then"
}
}
]
},
{
"type": "FIELD",
"name": "alternative",
"content": {
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "else"
},
{
"type": "SYMBOL",
"name": "elsif"
}
]
},
{
"type": "BLANK"
}
]
}
},
{
"type": "STRING",
"value": "end"
}
]
},
"elsif": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "elsif"
},
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "SYMBOL",
"name": "_statement"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_terminator"
},
{
"type": "FIELD",
"name": "consequence",
"content": {