fn read_node_body(
buffer: &mut SerializationBuffer,
type_id: u8,
pool: usize,
node: &mut PrismNode,
stack: &mut Vec<Option<PrismNode>>,
) {
match type_id {
1 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let old_name_child = stack.pop().flatten();
let new_name_child = stack.pop().flatten();
if let Some(child) = new_name_child {
node.children.push(child);
}
if let Some(child) = old_name_child {
node.children.push(child);
}
}
2 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let old_name_child = stack.pop().flatten();
let new_name_child = stack.pop().flatten();
if let Some(child) = new_name_child {
node.children.push(child);
}
if let Some(child) = old_name_child {
node.children.push(child);
}
}
3 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let right_child = stack.pop().flatten();
let left_child = stack.pop().flatten();
if let Some(child) = left_child {
node.children.push(child);
}
if let Some(child) = right_child {
node.children.push(child);
}
}
4 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let right_child = stack.pop().flatten();
let left_child = stack.pop().flatten();
if let Some(child) = left_child {
node.children.push(child);
}
if let Some(child) = right_child {
node.children.push(child);
}
}
5 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
let arguments_count = buffer.read_var_int();
let arguments_children = stack.split_off(stack.len().saturating_sub(arguments_count));
node.children.extend(arguments_children.into_iter().flatten());
}
6 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
let elements_count = buffer.read_var_int();
buffer.read_optional_location();
buffer.read_optional_location();
let elements_children = stack.split_off(stack.len().saturating_sub(elements_count));
node.children.extend(elements_children.into_iter().flatten());
}
7 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
let requireds_count = buffer.read_var_int();
let posts_count = buffer.read_var_int();
buffer.read_optional_location();
buffer.read_optional_location();
let posts_children = stack.split_off(stack.len().saturating_sub(posts_count));
let rest_child = stack.pop().flatten();
let requireds_children = stack.split_off(stack.len().saturating_sub(requireds_count));
let constant_child = stack.pop().flatten();
if let Some(child) = constant_child {
node.children.push(child);
}
node.children.extend(requireds_children.into_iter().flatten());
if let Some(child) = rest_child {
node.children.push(child);
}
node.children.extend(posts_children.into_iter().flatten());
}
8 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_optional_location();
let value_child = stack.pop().flatten();
let key_child = stack.pop().flatten();
if let Some(child) = key_child {
node.children.push(child);
node.key = Some(Box::new(node.children[node.children.len() - 1].clone()));
}
if let Some(child) = value_child {
node.children.push(child);
}
}
9 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
10 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
}
11 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_optional_location();
buffer.read_optional_location();
let ensure_clause_child = stack.pop().flatten();
let else_clause_child = stack.pop().flatten();
let rescue_clause_child = stack.pop().flatten();
let statements_child = stack.pop().flatten();
if let Some(child) = statements_child {
node.children.push(child);
}
if let Some(child) = rescue_clause_child {
node.children.push(child);
}
if let Some(child) = else_clause_child {
node.children.push(child);
}
if let Some(child) = ensure_clause_child {
node.children.push(child);
}
}
12 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let expression_child = stack.pop().flatten();
if let Some(child) = expression_child {
node.children.push(child);
}
}
13 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
}
14 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
{
let count = buffer.read_var_int();
for _ in 0..count {
buffer.read_required_constant(pool);
}
}
buffer.read_location();
buffer.read_location();
let body_child = stack.pop().flatten();
let parameters_child = stack.pop().flatten();
if let Some(child) = parameters_child {
node.children.push(child);
}
if let Some(child) = body_child {
node.children.push(child);
}
}
15 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = buffer.read_optional_constant(pool);
buffer.read_optional_location();
buffer.read_location();
}
16 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
let locals_count = buffer.read_var_int();
buffer.read_optional_location();
buffer.read_optional_location();
let locals_children = stack.split_off(stack.len().saturating_sub(locals_count));
let parameters_child = stack.pop().flatten();
if let Some(child) = parameters_child {
node.children.push(child);
}
node.children.extend(locals_children.into_iter().flatten());
}
17 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let arguments_child = stack.pop().flatten();
if let Some(child) = arguments_child {
node.children.push(child);
}
}
18 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_optional_location();
buffer.read_optional_location();
buffer.read_required_constant(pool);
buffer.read_required_constant(pool);
buffer.read_location();
let value_child = stack.pop().flatten();
let receiver_child = stack.pop().flatten();
if let Some(child) = receiver_child {
node.children.push(child);
node.receiver_index = Some(node.children.len() - 1);
}
if let Some(child) = value_child {
node.children.push(child);
}
}
19 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_optional_location();
node.name = Some(buffer.read_required_constant(pool));
buffer.read_optional_location();
buffer.read_optional_location();
buffer.read_optional_location();
buffer.read_optional_location();
let block_child = stack.pop().flatten();
let arguments_child = stack.pop().flatten();
let receiver_child = stack.pop().flatten();
if let Some(child) = receiver_child {
node.children.push(child);
node.receiver_index = Some(node.children.len() - 1);
}
if let Some(child) = arguments_child {
node.children.push(child);
}
if let Some(child) = block_child {
node.children.push(child);
node.has_block = true;
}
}
20 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_optional_location();
buffer.read_optional_location();
buffer.read_required_constant(pool);
buffer.read_required_constant(pool);
buffer.read_required_constant(pool);
buffer.read_location();
let value_child = stack.pop().flatten();
let receiver_child = stack.pop().flatten();
if let Some(child) = receiver_child {
node.children.push(child);
node.receiver_index = Some(node.children.len() - 1);
}
if let Some(child) = value_child {
node.children.push(child);
}
}
21 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_optional_location();
buffer.read_optional_location();
buffer.read_required_constant(pool);
buffer.read_required_constant(pool);
buffer.read_location();
let value_child = stack.pop().flatten();
let receiver_child = stack.pop().flatten();
if let Some(child) = receiver_child {
node.children.push(child);
node.receiver_index = Some(node.children.len() - 1);
}
if let Some(child) = value_child {
node.children.push(child);
}
}
22 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
let receiver_child = stack.pop().flatten();
if let Some(child) = receiver_child {
node.children.push(child);
node.receiver_index = Some(node.children.len() - 1);
}
}
23 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let target_child = stack.pop().flatten();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
if let Some(child) = target_child {
node.children.push(child);
}
}
24 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
let conditions_count = buffer.read_var_int();
buffer.read_location();
buffer.read_location();
let else_clause_child = stack.pop().flatten();
let conditions_children = stack.split_off(stack.len().saturating_sub(conditions_count));
let predicate_child = stack.pop().flatten();
if let Some(child) = predicate_child {
node.children.push(child);
}
node.children.extend(conditions_children.into_iter().flatten());
if let Some(child) = else_clause_child {
node.children.push(child);
}
}
25 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
let conditions_count = buffer.read_var_int();
buffer.read_location();
buffer.read_location();
let else_clause_child = stack.pop().flatten();
let conditions_children = stack.split_off(stack.len().saturating_sub(conditions_count));
let predicate_child = stack.pop().flatten();
if let Some(child) = predicate_child {
node.children.push(child);
}
node.children.extend(conditions_children.into_iter().flatten());
if let Some(child) = else_clause_child {
node.children.push(child);
}
}
26 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
{
let count = buffer.read_var_int();
for _ in 0..count {
buffer.read_required_constant(pool);
}
}
buffer.read_location();
buffer.read_optional_location();
buffer.read_location();
node.name = Some(buffer.read_required_constant(pool));
let body_child = stack.pop().flatten();
let superclass_child = stack.pop().flatten();
let constant_path_child = stack.pop().flatten();
if let Some(child) = constant_path_child {
node.children.push(child);
}
if let Some(child) = superclass_child {
node.children.push(child);
}
if let Some(child) = body_child {
node.children.push(child);
}
}
27 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
buffer.read_location();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
28 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
buffer.read_location();
buffer.read_required_constant(pool);
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
29 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
buffer.read_location();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
30 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
}
31 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
}
32 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
buffer.read_location();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
33 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
buffer.read_location();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
34 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
buffer.read_location();
buffer.read_required_constant(pool);
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
35 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
buffer.read_location();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
36 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let value_child = stack.pop().flatten();
let target_child = stack.pop().flatten();
if let Some(child) = target_child {
node.children.push(child);
}
if let Some(child) = value_child {
node.children.push(child);
}
}
37 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = buffer.read_optional_constant(pool);
buffer.read_location();
buffer.read_location();
let parent_child = stack.pop().flatten();
if let Some(child) = parent_child {
node.children.push(child);
}
}
38 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_required_constant(pool);
let value_child = stack.pop().flatten();
let target_child = stack.pop().flatten();
if let Some(child) = target_child {
node.children.push(child);
}
if let Some(child) = value_child {
node.children.push(child);
}
}
39 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let value_child = stack.pop().flatten();
let target_child = stack.pop().flatten();
if let Some(child) = target_child {
node.children.push(child);
}
if let Some(child) = value_child {
node.children.push(child);
}
}
40 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = buffer.read_optional_constant(pool);
buffer.read_location();
buffer.read_location();
let parent_child = stack.pop().flatten();
if let Some(child) = parent_child {
node.children.push(child);
}
}
41 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let value_child = stack.pop().flatten();
let target_child = stack.pop().flatten();
if let Some(child) = target_child {
node.children.push(child);
}
if let Some(child) = value_child {
node.children.push(child);
}
}
42 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
}
43 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
}
44 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
buffer.read_location();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
45 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
{
let count = buffer.read_var_int();
for _ in 0..count {
buffer.read_required_constant(pool);
}
}
buffer.read_location();
buffer.read_optional_location();
buffer.read_optional_location();
buffer.read_optional_location();
buffer.read_optional_location();
buffer.read_optional_location();
let body_child = stack.pop().flatten();
let parameters_child = stack.pop().flatten();
let receiver_child = stack.pop().flatten();
if let Some(child) = receiver_child {
node.children.push(child);
node.receiver_index = Some(node.children.len() - 1);
}
if let Some(child) = parameters_child {
node.children.push(child);
}
if let Some(child) = body_child {
node.children.push(child);
}
}
46 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_optional_location();
buffer.read_optional_location();
buffer.read_location();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
47 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_optional_location();
let statements_child = stack.pop().flatten();
if let Some(child) = statements_child {
node.children.push(child);
}
}
48 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_location();
let statements_child = stack.pop().flatten();
if let Some(child) = statements_child {
node.children.push(child);
}
}
49 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let variable_child = stack.pop().flatten();
if let Some(child) = variable_child {
node.children.push(child);
}
}
50 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_location();
let statements_child = stack.pop().flatten();
if let Some(child) = statements_child {
node.children.push(child);
}
}
51 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
let unexpected_child = stack.pop().flatten();
if let Some(child) = unexpected_child {
node.children.push(child);
}
}
52 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
}
53 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
let requireds_count = buffer.read_var_int();
buffer.read_optional_location();
buffer.read_optional_location();
let right_child = stack.pop().flatten();
let requireds_children = stack.split_off(stack.len().saturating_sub(requireds_count));
let left_child = stack.pop().flatten();
let constant_child = stack.pop().flatten();
if let Some(child) = constant_child {
node.children.push(child);
}
if let Some(child) = left_child {
node.children.push(child);
}
node.children.extend(requireds_children.into_iter().flatten());
if let Some(child) = right_child {
node.children.push(child);
}
}
54 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let right_child = stack.pop().flatten();
let left_child = stack.pop().flatten();
if let Some(child) = left_child {
node.children.push(child);
}
if let Some(child) = right_child {
node.children.push(child);
}
}
55 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_double();
}
56 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_location();
buffer.read_optional_location();
buffer.read_location();
let statements_child = stack.pop().flatten();
let collection_child = stack.pop().flatten();
let index_child = stack.pop().flatten();
if let Some(child) = index_child {
node.children.push(child);
}
if let Some(child) = collection_child {
node.children.push(child);
}
if let Some(child) = statements_child {
node.children.push(child);
}
}
57 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
}
58 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
}
59 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let block_child = stack.pop().flatten();
if let Some(child) = block_child {
node.children.push(child);
node.has_block = true;
}
}
60 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
buffer.read_location();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
61 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
buffer.read_location();
buffer.read_required_constant(pool);
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
62 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
buffer.read_location();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
63 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
}
64 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
}
65 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
buffer.read_location();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
66 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let elements_count = buffer.read_var_int();
buffer.read_location();
let elements_children = stack.split_off(stack.len().saturating_sub(elements_count));
node.children.extend(elements_children.into_iter().flatten());
}
67 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
let elements_count = buffer.read_var_int();
buffer.read_optional_location();
buffer.read_optional_location();
let rest_child = stack.pop().flatten();
let elements_children = stack.split_off(stack.len().saturating_sub(elements_count));
let constant_child = stack.pop().flatten();
if let Some(child) = constant_child {
node.children.push(child);
}
node.children.extend(elements_children.into_iter().flatten());
if let Some(child) = rest_child {
node.children.push(child);
}
}
68 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_optional_location();
buffer.read_optional_location();
buffer.read_optional_location();
let subsequent_child = stack.pop().flatten();
let statements_child = stack.pop().flatten();
let predicate_child = stack.pop().flatten();
if let Some(child) = predicate_child {
node.children.push(child);
}
if let Some(child) = statements_child {
node.children.push(child);
}
if let Some(child) = subsequent_child {
node.children.push(child);
}
}
69 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
let numeric_child = stack.pop().flatten();
if let Some(child) = numeric_child {
node.children.push(child);
}
}
70 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
71 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
}
72 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_optional_location();
let statements_child = stack.pop().flatten();
let pattern_child = stack.pop().flatten();
if let Some(child) = pattern_child {
node.children.push(child);
}
if let Some(child) = statements_child {
node.children.push(child);
}
}
73 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_optional_location();
buffer.read_location();
buffer.read_location();
buffer.read_location();
let value_child = stack.pop().flatten();
let block_child = stack.pop().flatten();
let arguments_child = stack.pop().flatten();
let receiver_child = stack.pop().flatten();
if let Some(child) = receiver_child {
node.children.push(child);
node.receiver_index = Some(node.children.len() - 1);
}
if let Some(child) = arguments_child {
node.children.push(child);
}
if let Some(child) = block_child {
node.children.push(child);
node.has_block = true;
}
if let Some(child) = value_child {
node.children.push(child);
}
}
74 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_optional_location();
buffer.read_location();
buffer.read_location();
buffer.read_required_constant(pool);
buffer.read_location();
let value_child = stack.pop().flatten();
let block_child = stack.pop().flatten();
let arguments_child = stack.pop().flatten();
let receiver_child = stack.pop().flatten();
if let Some(child) = receiver_child {
node.children.push(child);
node.receiver_index = Some(node.children.len() - 1);
}
if let Some(child) = arguments_child {
node.children.push(child);
}
if let Some(child) = block_child {
node.children.push(child);
node.has_block = true;
}
if let Some(child) = value_child {
node.children.push(child);
}
}
75 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_optional_location();
buffer.read_location();
buffer.read_location();
buffer.read_location();
let value_child = stack.pop().flatten();
let block_child = stack.pop().flatten();
let arguments_child = stack.pop().flatten();
let receiver_child = stack.pop().flatten();
if let Some(child) = receiver_child {
node.children.push(child);
node.receiver_index = Some(node.children.len() - 1);
}
if let Some(child) = arguments_child {
node.children.push(child);
}
if let Some(child) = block_child {
node.children.push(child);
node.has_block = true;
}
if let Some(child) = value_child {
node.children.push(child);
}
}
76 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_location();
let block_child = stack.pop().flatten();
let arguments_child = stack.pop().flatten();
let receiver_child = stack.pop().flatten();
if let Some(child) = receiver_child {
node.children.push(child);
node.receiver_index = Some(node.children.len() - 1);
}
if let Some(child) = arguments_child {
node.children.push(child);
}
if let Some(child) = block_child {
node.children.push(child);
node.has_block = true;
}
}
77 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
buffer.read_location();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
78 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
buffer.read_location();
buffer.read_required_constant(pool);
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
79 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
buffer.read_location();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
80 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
}
81 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
}
82 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
buffer.read_location();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
83 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_integer();
}
84 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let parts_count = buffer.read_var_int();
buffer.read_location();
let parts_children = stack.split_off(stack.len().saturating_sub(parts_count));
node.children.extend(parts_children.into_iter().flatten());
}
85 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let parts_count = buffer.read_var_int();
buffer.read_location();
let parts_children = stack.split_off(stack.len().saturating_sub(parts_count));
node.children.extend(parts_children.into_iter().flatten());
}
86 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_optional_location();
let parts_count = buffer.read_var_int();
buffer.read_optional_location();
let parts_children = stack.split_off(stack.len().saturating_sub(parts_count));
node.children.extend(parts_children.into_iter().flatten());
}
87 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_optional_location();
let parts_count = buffer.read_var_int();
buffer.read_optional_location();
let parts_children = stack.split_off(stack.len().saturating_sub(parts_count));
node.children.extend(parts_children.into_iter().flatten());
}
88 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let parts_count = buffer.read_var_int();
buffer.read_location();
let parts_children = stack.split_off(stack.len().saturating_sub(parts_count));
node.children.extend(parts_children.into_iter().flatten());
}
89 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
}
90 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
}
91 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
let elements_count = buffer.read_var_int();
let elements_children = stack.split_off(stack.len().saturating_sub(elements_count));
node.children.extend(elements_children.into_iter().flatten());
}
92 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = buffer.read_optional_constant(pool);
buffer.read_optional_location();
buffer.read_location();
}
93 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
{
let count = buffer.read_var_int();
for _ in 0..count {
buffer.read_required_constant(pool);
}
}
buffer.read_location();
buffer.read_location();
buffer.read_location();
let body_child = stack.pop().flatten();
let parameters_child = stack.pop().flatten();
if let Some(child) = parameters_child {
node.children.push(child);
}
if let Some(child) = body_child {
node.children.push(child);
}
}
94 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_location();
node.name = Some(buffer.read_required_constant(pool));
buffer.read_var_int();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
95 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_location();
node.name = Some(buffer.read_required_constant(pool));
buffer.read_required_constant(pool);
buffer.read_var_int();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
96 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_location();
node.name = Some(buffer.read_required_constant(pool));
buffer.read_var_int();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
97 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_var_int();
}
98 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_var_int();
}
99 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_var_int();
buffer.read_location();
buffer.read_location();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
100 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_location();
buffer.read_location();
node.unescaped = Some(buffer.read_string_field(flags));
}
101 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let pattern_child = stack.pop().flatten();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
if let Some(child) = pattern_child {
node.children.push(child);
}
}
102 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let pattern_child = stack.pop().flatten();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
if let Some(child) = pattern_child {
node.children.push(child);
}
}
103 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
let targets_count = buffer.read_var_int();
let targets_children = stack.split_off(stack.len().saturating_sub(targets_count));
let call_child = stack.pop().flatten();
if let Some(child) = call_child {
node.children.push(child);
}
node.children.extend(targets_children.into_iter().flatten());
}
104 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
{
let count = buffer.read_var_int();
for _ in 0..count {
buffer.read_required_constant(pool);
}
}
buffer.read_location();
buffer.read_location();
node.name = Some(buffer.read_required_constant(pool));
let body_child = stack.pop().flatten();
let constant_path_child = stack.pop().flatten();
if let Some(child) = constant_path_child {
node.children.push(child);
}
if let Some(child) = body_child {
node.children.push(child);
}
}
105 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
let lefts_count = buffer.read_var_int();
let rights_count = buffer.read_var_int();
buffer.read_optional_location();
buffer.read_optional_location();
let rights_children = stack.split_off(stack.len().saturating_sub(rights_count));
let rest_child = stack.pop().flatten();
let lefts_children = stack.split_off(stack.len().saturating_sub(lefts_count));
node.children.extend(lefts_children.into_iter().flatten());
if let Some(child) = rest_child {
node.children.push(child);
}
node.children.extend(rights_children.into_iter().flatten());
}
106 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
let lefts_count = buffer.read_var_int();
let rights_count = buffer.read_var_int();
buffer.read_optional_location();
buffer.read_optional_location();
buffer.read_location();
let value_child = stack.pop().flatten();
let rights_children = stack.split_off(stack.len().saturating_sub(rights_count));
let rest_child = stack.pop().flatten();
let lefts_children = stack.split_off(stack.len().saturating_sub(lefts_count));
node.children.extend(lefts_children.into_iter().flatten());
if let Some(child) = rest_child {
node.children.push(child);
}
node.children.extend(rights_children.into_iter().flatten());
if let Some(child) = value_child {
node.children.push(child);
}
}
107 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let arguments_child = stack.pop().flatten();
if let Some(child) = arguments_child {
node.children.push(child);
}
}
108 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
}
109 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_location();
}
110 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_location();
}
111 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_byte();
}
112 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_var_int();
}
113 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
114 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
buffer.read_location();
let value_child = stack.pop().flatten();
if let Some(child) = value_child {
node.children.push(child);
}
}
115 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let right_child = stack.pop().flatten();
let left_child = stack.pop().flatten();
if let Some(child) = left_child {
node.children.push(child);
}
if let Some(child) = right_child {
node.children.push(child);
}
}
116 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
let requireds_count = buffer.read_var_int();
let optionals_count = buffer.read_var_int();
let posts_count = buffer.read_var_int();
let keywords_count = buffer.read_var_int();
let block_child = stack.pop().flatten();
let keyword_rest_child = stack.pop().flatten();
let keywords_children = stack.split_off(stack.len().saturating_sub(keywords_count));
let posts_children = stack.split_off(stack.len().saturating_sub(posts_count));
let rest_child = stack.pop().flatten();
let optionals_children = stack.split_off(stack.len().saturating_sub(optionals_count));
let requireds_children = stack.split_off(stack.len().saturating_sub(requireds_count));
node.children.extend(requireds_children.into_iter().flatten());
node.children.extend(optionals_children.into_iter().flatten());
if let Some(child) = rest_child {
node.children.push(child);
}
node.children.extend(posts_children.into_iter().flatten());
node.children.extend(keywords_children.into_iter().flatten());
if let Some(child) = keyword_rest_child {
node.children.push(child);
}
if let Some(child) = block_child {
node.children.push(child);
node.has_block = true;
}
}
117 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_location();
let body_child = stack.pop().flatten();
if let Some(child) = body_child {
node.children.push(child);
}
}
118 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_location();
buffer.read_location();
let expression_child = stack.pop().flatten();
if let Some(child) = expression_child {
node.children.push(child);
}
}
119 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let variable_child = stack.pop().flatten();
if let Some(child) = variable_child {
node.children.push(child);
}
}
120 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_location();
buffer.read_location();
let statements_child = stack.pop().flatten();
if let Some(child) = statements_child {
node.children.push(child);
}
}
121 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_location();
buffer.read_location();
let statements_child = stack.pop().flatten();
if let Some(child) = statements_child {
node.children.push(child);
}
}
122 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
{
let count = buffer.read_var_int();
for _ in 0..count {
buffer.read_required_constant(pool);
}
}
let statements_child = stack.pop().flatten();
if let Some(child) = statements_child {
node.children.push(child);
}
}
123 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let right_child = stack.pop().flatten();
let left_child = stack.pop().flatten();
if let Some(child) = left_child {
node.children.push(child);
}
if let Some(child) = right_child {
node.children.push(child);
}
}
124 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_integer();
buffer.read_integer();
}
125 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
}
126 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_location();
buffer.read_location();
node.unescaped = Some(buffer.read_string_field(flags));
}
127 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
buffer.read_location();
}
128 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = Some(buffer.read_required_constant(pool));
}
129 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let rescue_expression_child = stack.pop().flatten();
let expression_child = stack.pop().flatten();
if let Some(child) = expression_child {
node.children.push(child);
}
if let Some(child) = rescue_expression_child {
node.children.push(child);
}
}
130 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let exceptions_count = buffer.read_var_int();
buffer.read_optional_location();
buffer.read_optional_location();
let subsequent_child = stack.pop().flatten();
let statements_child = stack.pop().flatten();
let reference_child = stack.pop().flatten();
let exceptions_children = stack.split_off(stack.len().saturating_sub(exceptions_count));
node.children.extend(exceptions_children.into_iter().flatten());
if let Some(child) = reference_child {
node.children.push(child);
}
if let Some(child) = statements_child {
node.children.push(child);
}
if let Some(child) = subsequent_child {
node.children.push(child);
}
}
131 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
node.name = buffer.read_optional_constant(pool);
buffer.read_optional_location();
buffer.read_location();
}
132 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
}
133 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let arguments_child = stack.pop().flatten();
if let Some(child) = arguments_child {
node.children.push(child);
}
}
134 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
}
135 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
let write_child = stack.pop().flatten();
if let Some(child) = write_child {
node.children.push(child);
}
}
136 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
{
let count = buffer.read_var_int();
for _ in 0..count {
buffer.read_required_constant(pool);
}
}
buffer.read_location();
buffer.read_location();
buffer.read_location();
let body_child = stack.pop().flatten();
let expression_child = stack.pop().flatten();
if let Some(child) = expression_child {
node.children.push(child);
}
if let Some(child) = body_child {
node.children.push(child);
}
}
137 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
}
138 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_string_field(flags);
}
139 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
}
140 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let expression_child = stack.pop().flatten();
if let Some(child) = expression_child {
node.children.push(child);
}
}
141 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
let body_count = buffer.read_var_int();
let body_children = stack.split_off(stack.len().saturating_sub(body_count));
node.children.extend(body_children.into_iter().flatten());
}
142 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_optional_location();
buffer.read_location();
buffer.read_optional_location();
node.unescaped = Some(buffer.read_string_field(flags));
}
143 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_optional_location();
buffer.read_optional_location();
let block_child = stack.pop().flatten();
let arguments_child = stack.pop().flatten();
if let Some(child) = arguments_child {
node.children.push(child);
}
if let Some(child) = block_child {
node.children.push(child);
node.has_block = true;
}
}
144 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_optional_location();
buffer.read_location();
buffer.read_optional_location();
node.unescaped = Some(buffer.read_string_field(flags));
}
145 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
}
146 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
let names_count = buffer.read_var_int();
buffer.read_location();
let names_children = stack.split_off(stack.len().saturating_sub(names_count));
node.children.extend(names_children.into_iter().flatten());
}
147 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_optional_location();
buffer.read_optional_location();
let else_clause_child = stack.pop().flatten();
let statements_child = stack.pop().flatten();
let predicate_child = stack.pop().flatten();
if let Some(child) = predicate_child {
node.children.push(child);
}
if let Some(child) = statements_child {
node.children.push(child);
}
if let Some(child) = else_clause_child {
node.children.push(child);
}
}
148 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_optional_location();
buffer.read_optional_location();
let statements_child = stack.pop().flatten();
let predicate_child = stack.pop().flatten();
if let Some(child) = predicate_child {
node.children.push(child);
}
if let Some(child) = statements_child {
node.children.push(child);
}
}
149 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
let conditions_count = buffer.read_var_int();
buffer.read_optional_location();
let statements_child = stack.pop().flatten();
let conditions_children = stack.split_off(stack.len().saturating_sub(conditions_count));
node.children.extend(conditions_children.into_iter().flatten());
if let Some(child) = statements_child {
node.children.push(child);
}
}
150 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_optional_location();
buffer.read_optional_location();
let statements_child = stack.pop().flatten();
let predicate_child = stack.pop().flatten();
if let Some(child) = predicate_child {
node.children.push(child);
}
if let Some(child) = statements_child {
node.children.push(child);
}
}
151 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_location();
buffer.read_location();
node.unescaped = Some(buffer.read_string_field(flags));
}
152 => {
let flags = buffer.read_var_int() as u32;
node.flags = flags;
buffer.read_location();
buffer.read_optional_location();
buffer.read_optional_location();
let arguments_child = stack.pop().flatten();
if let Some(child) = arguments_child {
node.children.push(child);
}
}
_ => {}
}
}
fn record_child_count(buffer: &mut SerializationBuffer, type_id: u8, pool: usize) -> usize {
#[allow(unused_mut)]
let mut count = 0;
match type_id {
1 => {
buffer.read_var_int();
count += 1;
count += 1;
buffer.read_location();
}
2 => {
buffer.read_var_int();
count += 1;
count += 1;
buffer.read_location();
}
3 => {
buffer.read_var_int();
count += 1;
count += 1;
buffer.read_location();
}
4 => {
buffer.read_var_int();
count += 1;
count += 1;
buffer.read_location();
}
5 => {
buffer.read_var_int();
count += buffer.read_var_int();
}
6 => {
buffer.read_var_int();
count += buffer.read_var_int();
buffer.read_optional_location();
buffer.read_optional_location();
}
7 => {
buffer.read_var_int();
count += 1;
count += buffer.read_var_int();
count += 1;
count += buffer.read_var_int();
buffer.read_optional_location();
buffer.read_optional_location();
}
8 => {
buffer.read_var_int();
count += 1;
count += 1;
buffer.read_optional_location();
}
9 => {
buffer.read_var_int();
count += 1;
buffer.read_location();
}
10 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
}
11 => {
buffer.read_var_int();
buffer.read_optional_location();
count += 1;
count += 1;
count += 1;
count += 1;
buffer.read_optional_location();
}
12 => {
buffer.read_var_int();
count += 1;
buffer.read_location();
}
13 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
}
14 => {
buffer.read_var_int();
for _ in 0..buffer.read_var_int() {
buffer.read_required_constant(pool);
}
count += 1;
count += 1;
buffer.read_location();
buffer.read_location();
}
15 => {
buffer.read_var_int();
buffer.read_optional_constant(pool);
buffer.read_optional_location();
buffer.read_location();
}
16 => {
buffer.read_var_int();
count += 1;
count += buffer.read_var_int();
buffer.read_optional_location();
buffer.read_optional_location();
}
17 => {
buffer.read_var_int();
count += 1;
buffer.read_location();
}
18 => {
buffer.read_var_int();
count += 1;
buffer.read_optional_location();
buffer.read_optional_location();
buffer.read_required_constant(pool);
buffer.read_required_constant(pool);
buffer.read_location();
count += 1;
}
19 => {
buffer.read_var_int();
count += 1;
buffer.read_optional_location();
buffer.read_required_constant(pool);
buffer.read_optional_location();
buffer.read_optional_location();
count += 1;
buffer.read_optional_location();
buffer.read_optional_location();
count += 1;
}
20 => {
buffer.read_var_int();
count += 1;
buffer.read_optional_location();
buffer.read_optional_location();
buffer.read_required_constant(pool);
buffer.read_required_constant(pool);
buffer.read_required_constant(pool);
buffer.read_location();
count += 1;
}
21 => {
buffer.read_var_int();
count += 1;
buffer.read_optional_location();
buffer.read_optional_location();
buffer.read_required_constant(pool);
buffer.read_required_constant(pool);
buffer.read_location();
count += 1;
}
22 => {
buffer.read_var_int();
count += 1;
buffer.read_location();
buffer.read_required_constant(pool);
buffer.read_location();
}
23 => {
buffer.read_var_int();
count += 1;
count += 1;
buffer.read_location();
}
24 => {
buffer.read_var_int();
count += 1;
count += buffer.read_var_int();
count += 1;
buffer.read_location();
buffer.read_location();
}
25 => {
buffer.read_var_int();
count += 1;
count += buffer.read_var_int();
count += 1;
buffer.read_location();
buffer.read_location();
}
26 => {
buffer.read_var_int();
for _ in 0..buffer.read_var_int() {
buffer.read_required_constant(pool);
}
buffer.read_location();
count += 1;
buffer.read_optional_location();
count += 1;
count += 1;
buffer.read_location();
buffer.read_required_constant(pool);
}
27 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_location();
buffer.read_location();
count += 1;
}
28 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_location();
buffer.read_location();
count += 1;
buffer.read_required_constant(pool);
}
29 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_location();
buffer.read_location();
count += 1;
}
30 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
}
31 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
}
32 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_location();
count += 1;
buffer.read_location();
}
33 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_location();
buffer.read_location();
count += 1;
}
34 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_location();
buffer.read_location();
count += 1;
buffer.read_required_constant(pool);
}
35 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_location();
buffer.read_location();
count += 1;
}
36 => {
buffer.read_var_int();
count += 1;
buffer.read_location();
count += 1;
}
37 => {
buffer.read_var_int();
count += 1;
buffer.read_optional_constant(pool);
buffer.read_location();
buffer.read_location();
}
38 => {
buffer.read_var_int();
count += 1;
buffer.read_location();
count += 1;
buffer.read_required_constant(pool);
}
39 => {
buffer.read_var_int();
count += 1;
buffer.read_location();
count += 1;
}
40 => {
buffer.read_var_int();
count += 1;
buffer.read_optional_constant(pool);
buffer.read_location();
buffer.read_location();
}
41 => {
buffer.read_var_int();
count += 1;
buffer.read_location();
count += 1;
}
42 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
}
43 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
}
44 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_location();
count += 1;
buffer.read_location();
}
45 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_location();
count += 1;
count += 1;
count += 1;
for _ in 0..buffer.read_var_int() {
buffer.read_required_constant(pool);
}
buffer.read_location();
buffer.read_optional_location();
buffer.read_optional_location();
buffer.read_optional_location();
buffer.read_optional_location();
buffer.read_optional_location();
}
46 => {
buffer.read_var_int();
buffer.read_optional_location();
count += 1;
buffer.read_optional_location();
buffer.read_location();
}
47 => {
buffer.read_var_int();
buffer.read_location();
count += 1;
buffer.read_optional_location();
}
48 => {
buffer.read_var_int();
buffer.read_location();
count += 1;
buffer.read_location();
}
49 => {
buffer.read_var_int();
buffer.read_location();
count += 1;
}
50 => {
buffer.read_var_int();
buffer.read_location();
count += 1;
buffer.read_location();
}
51 => {
buffer.read_var_int();
count += 1;
}
52 => {
buffer.read_var_int();
}
53 => {
buffer.read_var_int();
count += 1;
count += 1;
count += buffer.read_var_int();
count += 1;
buffer.read_optional_location();
buffer.read_optional_location();
}
54 => {
buffer.read_var_int();
count += 1;
count += 1;
buffer.read_location();
}
55 => {
buffer.read_var_int();
buffer.read_double();
}
56 => {
buffer.read_var_int();
count += 1;
count += 1;
count += 1;
buffer.read_location();
buffer.read_location();
buffer.read_optional_location();
buffer.read_location();
}
57 => {
buffer.read_var_int();
}
58 => {
buffer.read_var_int();
}
59 => {
buffer.read_var_int();
buffer.read_location();
count += 1;
}
60 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_location();
buffer.read_location();
count += 1;
}
61 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_location();
buffer.read_location();
count += 1;
buffer.read_required_constant(pool);
}
62 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_location();
buffer.read_location();
count += 1;
}
63 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
}
64 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
}
65 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_location();
count += 1;
buffer.read_location();
}
66 => {
buffer.read_var_int();
buffer.read_location();
count += buffer.read_var_int();
buffer.read_location();
}
67 => {
buffer.read_var_int();
count += 1;
count += buffer.read_var_int();
count += 1;
buffer.read_optional_location();
buffer.read_optional_location();
}
68 => {
buffer.read_var_int();
buffer.read_optional_location();
count += 1;
buffer.read_optional_location();
count += 1;
count += 1;
buffer.read_optional_location();
}
69 => {
buffer.read_var_int();
count += 1;
}
70 => {
buffer.read_var_int();
count += 1;
}
71 => {
buffer.read_var_int();
}
72 => {
buffer.read_var_int();
count += 1;
count += 1;
buffer.read_location();
buffer.read_optional_location();
}
73 => {
buffer.read_var_int();
count += 1;
buffer.read_optional_location();
buffer.read_location();
count += 1;
buffer.read_location();
count += 1;
buffer.read_location();
count += 1;
}
74 => {
buffer.read_var_int();
count += 1;
buffer.read_optional_location();
buffer.read_location();
count += 1;
buffer.read_location();
count += 1;
buffer.read_required_constant(pool);
buffer.read_location();
count += 1;
}
75 => {
buffer.read_var_int();
count += 1;
buffer.read_optional_location();
buffer.read_location();
count += 1;
buffer.read_location();
count += 1;
buffer.read_location();
count += 1;
}
76 => {
buffer.read_var_int();
count += 1;
buffer.read_location();
count += 1;
buffer.read_location();
count += 1;
}
77 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_location();
buffer.read_location();
count += 1;
}
78 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_location();
buffer.read_location();
count += 1;
buffer.read_required_constant(pool);
}
79 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_location();
buffer.read_location();
count += 1;
}
80 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
}
81 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
}
82 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_location();
count += 1;
buffer.read_location();
}
83 => {
buffer.read_var_int();
buffer.read_integer();
}
84 => {
buffer.read_var_int();
buffer.read_location();
count += buffer.read_var_int();
buffer.read_location();
}
85 => {
buffer.read_var_int();
buffer.read_location();
count += buffer.read_var_int();
buffer.read_location();
}
86 => {
buffer.read_var_int();
buffer.read_optional_location();
count += buffer.read_var_int();
buffer.read_optional_location();
}
87 => {
buffer.read_var_int();
buffer.read_optional_location();
count += buffer.read_var_int();
buffer.read_optional_location();
}
88 => {
buffer.read_var_int();
buffer.read_location();
count += buffer.read_var_int();
buffer.read_location();
}
89 => {
buffer.read_var_int();
}
90 => {
buffer.read_var_int();
}
91 => {
buffer.read_var_int();
count += buffer.read_var_int();
}
92 => {
buffer.read_var_int();
buffer.read_optional_constant(pool);
buffer.read_optional_location();
buffer.read_location();
}
93 => {
buffer.read_var_int();
for _ in 0..buffer.read_var_int() {
buffer.read_required_constant(pool);
}
buffer.read_location();
buffer.read_location();
buffer.read_location();
count += 1;
count += 1;
}
94 => {
buffer.read_var_int();
buffer.read_location();
buffer.read_location();
count += 1;
buffer.read_required_constant(pool);
buffer.read_var_int();
}
95 => {
buffer.read_var_int();
buffer.read_location();
buffer.read_location();
count += 1;
buffer.read_required_constant(pool);
buffer.read_required_constant(pool);
buffer.read_var_int();
}
96 => {
buffer.read_var_int();
buffer.read_location();
buffer.read_location();
count += 1;
buffer.read_required_constant(pool);
buffer.read_var_int();
}
97 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_var_int();
}
98 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_var_int();
}
99 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_var_int();
buffer.read_location();
count += 1;
buffer.read_location();
}
100 => {
buffer.read_var_int();
buffer.read_location();
buffer.read_location();
buffer.read_location();
buffer.read_string_field(0);
}
101 => {
buffer.read_var_int();
count += 1;
count += 1;
buffer.read_location();
}
102 => {
buffer.read_var_int();
count += 1;
count += 1;
buffer.read_location();
}
103 => {
buffer.read_var_int();
count += 1;
count += buffer.read_var_int();
}
104 => {
buffer.read_var_int();
for _ in 0..buffer.read_var_int() {
buffer.read_required_constant(pool);
}
buffer.read_location();
count += 1;
count += 1;
buffer.read_location();
buffer.read_required_constant(pool);
}
105 => {
buffer.read_var_int();
count += buffer.read_var_int();
count += 1;
count += buffer.read_var_int();
buffer.read_optional_location();
buffer.read_optional_location();
}
106 => {
buffer.read_var_int();
count += buffer.read_var_int();
count += 1;
count += buffer.read_var_int();
buffer.read_optional_location();
buffer.read_optional_location();
buffer.read_location();
count += 1;
}
107 => {
buffer.read_var_int();
count += 1;
buffer.read_location();
}
108 => {
buffer.read_var_int();
}
109 => {
buffer.read_var_int();
buffer.read_location();
buffer.read_location();
}
110 => {
buffer.read_var_int();
buffer.read_location();
buffer.read_location();
}
111 => {
buffer.read_var_int();
buffer.read_byte();
}
112 => {
buffer.read_var_int();
buffer.read_var_int();
}
113 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_location();
count += 1;
}
114 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_location();
buffer.read_location();
count += 1;
}
115 => {
buffer.read_var_int();
count += 1;
count += 1;
buffer.read_location();
}
116 => {
buffer.read_var_int();
count += buffer.read_var_int();
count += buffer.read_var_int();
count += 1;
count += buffer.read_var_int();
count += buffer.read_var_int();
count += 1;
count += 1;
}
117 => {
buffer.read_var_int();
count += 1;
buffer.read_location();
buffer.read_location();
}
118 => {
buffer.read_var_int();
count += 1;
buffer.read_location();
buffer.read_location();
buffer.read_location();
}
119 => {
buffer.read_var_int();
count += 1;
buffer.read_location();
}
120 => {
buffer.read_var_int();
count += 1;
buffer.read_location();
buffer.read_location();
buffer.read_location();
}
121 => {
buffer.read_var_int();
count += 1;
buffer.read_location();
buffer.read_location();
buffer.read_location();
}
122 => {
buffer.read_var_int();
for _ in 0..buffer.read_var_int() {
buffer.read_required_constant(pool);
}
count += 1;
}
123 => {
buffer.read_var_int();
count += 1;
count += 1;
buffer.read_location();
}
124 => {
buffer.read_var_int();
buffer.read_integer();
buffer.read_integer();
}
125 => {
buffer.read_var_int();
}
126 => {
buffer.read_var_int();
buffer.read_location();
buffer.read_location();
buffer.read_location();
buffer.read_string_field(0);
}
127 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
buffer.read_location();
}
128 => {
buffer.read_var_int();
buffer.read_required_constant(pool);
}
129 => {
buffer.read_var_int();
count += 1;
buffer.read_location();
count += 1;
}
130 => {
buffer.read_var_int();
buffer.read_location();
count += buffer.read_var_int();
buffer.read_optional_location();
count += 1;
buffer.read_optional_location();
count += 1;
count += 1;
}
131 => {
buffer.read_var_int();
buffer.read_optional_constant(pool);
buffer.read_optional_location();
buffer.read_location();
}
132 => {
buffer.read_var_int();
}
133 => {
buffer.read_var_int();
buffer.read_location();
count += 1;
}
134 => {
buffer.read_var_int();
}
135 => {
buffer.read_var_int();
count += 1;
}
136 => {
buffer.read_var_int();
for _ in 0..buffer.read_var_int() {
buffer.read_required_constant(pool);
}
buffer.read_location();
buffer.read_location();
count += 1;
count += 1;
buffer.read_location();
}
137 => {
buffer.read_var_int();
}
138 => {
buffer.read_var_int();
buffer.read_string_field(0);
}
139 => {
buffer.read_var_int();
}
140 => {
buffer.read_var_int();
buffer.read_location();
count += 1;
}
141 => {
buffer.read_var_int();
count += buffer.read_var_int();
}
142 => {
buffer.read_var_int();
buffer.read_optional_location();
buffer.read_location();
buffer.read_optional_location();
buffer.read_string_field(0);
}
143 => {
buffer.read_var_int();
buffer.read_location();
buffer.read_optional_location();
count += 1;
buffer.read_optional_location();
count += 1;
}
144 => {
buffer.read_var_int();
buffer.read_optional_location();
buffer.read_location();
buffer.read_optional_location();
buffer.read_string_field(0);
}
145 => {
buffer.read_var_int();
}
146 => {
buffer.read_var_int();
count += buffer.read_var_int();
buffer.read_location();
}
147 => {
buffer.read_var_int();
buffer.read_location();
count += 1;
buffer.read_optional_location();
count += 1;
count += 1;
buffer.read_optional_location();
}
148 => {
buffer.read_var_int();
buffer.read_location();
buffer.read_optional_location();
buffer.read_optional_location();
count += 1;
count += 1;
}
149 => {
buffer.read_var_int();
buffer.read_location();
count += buffer.read_var_int();
buffer.read_optional_location();
count += 1;
}
150 => {
buffer.read_var_int();
buffer.read_location();
buffer.read_optional_location();
buffer.read_optional_location();
count += 1;
count += 1;
}
151 => {
buffer.read_var_int();
buffer.read_location();
buffer.read_location();
buffer.read_location();
buffer.read_string_field(0);
}
152 => {
buffer.read_var_int();
buffer.read_location();
buffer.read_optional_location();
count += 1;
buffer.read_optional_location();
}
_ => {}
}
count
}
fn node_type_name_for(type_id: u8) -> String {
match type_id {
1 => "AliasGlobalVariableNode".to_string(),
2 => "AliasMethodNode".to_string(),
3 => "AlternationPatternNode".to_string(),
4 => "AndNode".to_string(),
5 => "ArgumentsNode".to_string(),
6 => "ArrayNode".to_string(),
7 => "ArrayPatternNode".to_string(),
8 => "AssocNode".to_string(),
9 => "AssocSplatNode".to_string(),
10 => "BackReferenceReadNode".to_string(),
11 => "BeginNode".to_string(),
12 => "BlockArgumentNode".to_string(),
13 => "BlockLocalVariableNode".to_string(),
14 => "BlockNode".to_string(),
15 => "BlockParameterNode".to_string(),
16 => "BlockParametersNode".to_string(),
17 => "BreakNode".to_string(),
18 => "CallAndWriteNode".to_string(),
19 => "CallNode".to_string(),
20 => "CallOperatorWriteNode".to_string(),
21 => "CallOrWriteNode".to_string(),
22 => "CallTargetNode".to_string(),
23 => "CapturePatternNode".to_string(),
24 => "CaseMatchNode".to_string(),
25 => "CaseNode".to_string(),
26 => "ClassNode".to_string(),
27 => "ClassVariableAndWriteNode".to_string(),
28 => "ClassVariableOperatorWriteNode".to_string(),
29 => "ClassVariableOrWriteNode".to_string(),
30 => "ClassVariableReadNode".to_string(),
31 => "ClassVariableTargetNode".to_string(),
32 => "ClassVariableWriteNode".to_string(),
33 => "ConstantAndWriteNode".to_string(),
34 => "ConstantOperatorWriteNode".to_string(),
35 => "ConstantOrWriteNode".to_string(),
36 => "ConstantPathAndWriteNode".to_string(),
37 => "ConstantPathNode".to_string(),
38 => "ConstantPathOperatorWriteNode".to_string(),
39 => "ConstantPathOrWriteNode".to_string(),
40 => "ConstantPathTargetNode".to_string(),
41 => "ConstantPathWriteNode".to_string(),
42 => "ConstantReadNode".to_string(),
43 => "ConstantTargetNode".to_string(),
44 => "ConstantWriteNode".to_string(),
45 => "DefNode".to_string(),
46 => "DefinedNode".to_string(),
47 => "ElseNode".to_string(),
48 => "EmbeddedStatementsNode".to_string(),
49 => "EmbeddedVariableNode".to_string(),
50 => "EnsureNode".to_string(),
51 => "ErrorRecoveryNode".to_string(),
52 => "FalseNode".to_string(),
53 => "FindPatternNode".to_string(),
54 => "FlipFlopNode".to_string(),
55 => "FloatNode".to_string(),
56 => "ForNode".to_string(),
57 => "ForwardingArgumentsNode".to_string(),
58 => "ForwardingParameterNode".to_string(),
59 => "ForwardingSuperNode".to_string(),
60 => "GlobalVariableAndWriteNode".to_string(),
61 => "GlobalVariableOperatorWriteNode".to_string(),
62 => "GlobalVariableOrWriteNode".to_string(),
63 => "GlobalVariableReadNode".to_string(),
64 => "GlobalVariableTargetNode".to_string(),
65 => "GlobalVariableWriteNode".to_string(),
66 => "HashNode".to_string(),
67 => "HashPatternNode".to_string(),
68 => "IfNode".to_string(),
69 => "ImaginaryNode".to_string(),
70 => "ImplicitNode".to_string(),
71 => "ImplicitRestNode".to_string(),
72 => "InNode".to_string(),
73 => "IndexAndWriteNode".to_string(),
74 => "IndexOperatorWriteNode".to_string(),
75 => "IndexOrWriteNode".to_string(),
76 => "IndexTargetNode".to_string(),
77 => "InstanceVariableAndWriteNode".to_string(),
78 => "InstanceVariableOperatorWriteNode".to_string(),
79 => "InstanceVariableOrWriteNode".to_string(),
80 => "InstanceVariableReadNode".to_string(),
81 => "InstanceVariableTargetNode".to_string(),
82 => "InstanceVariableWriteNode".to_string(),
83 => "IntegerNode".to_string(),
84 => "InterpolatedMatchLastLineNode".to_string(),
85 => "InterpolatedRegularExpressionNode".to_string(),
86 => "InterpolatedStringNode".to_string(),
87 => "InterpolatedSymbolNode".to_string(),
88 => "InterpolatedXStringNode".to_string(),
89 => "ItLocalVariableReadNode".to_string(),
90 => "ItParametersNode".to_string(),
91 => "KeywordHashNode".to_string(),
92 => "KeywordRestParameterNode".to_string(),
93 => "LambdaNode".to_string(),
94 => "LocalVariableAndWriteNode".to_string(),
95 => "LocalVariableOperatorWriteNode".to_string(),
96 => "LocalVariableOrWriteNode".to_string(),
97 => "LocalVariableReadNode".to_string(),
98 => "LocalVariableTargetNode".to_string(),
99 => "LocalVariableWriteNode".to_string(),
100 => "MatchLastLineNode".to_string(),
101 => "MatchPredicateNode".to_string(),
102 => "MatchRequiredNode".to_string(),
103 => "MatchWriteNode".to_string(),
104 => "ModuleNode".to_string(),
105 => "MultiTargetNode".to_string(),
106 => "MultiWriteNode".to_string(),
107 => "NextNode".to_string(),
108 => "NilNode".to_string(),
109 => "NoBlockParameterNode".to_string(),
110 => "NoKeywordsParameterNode".to_string(),
111 => "NumberedParametersNode".to_string(),
112 => "NumberedReferenceReadNode".to_string(),
113 => "OptionalKeywordParameterNode".to_string(),
114 => "OptionalParameterNode".to_string(),
115 => "OrNode".to_string(),
116 => "ParametersNode".to_string(),
117 => "ParenthesesNode".to_string(),
118 => "PinnedExpressionNode".to_string(),
119 => "PinnedVariableNode".to_string(),
120 => "PostExecutionNode".to_string(),
121 => "PreExecutionNode".to_string(),
122 => "ProgramNode".to_string(),
123 => "RangeNode".to_string(),
124 => "RationalNode".to_string(),
125 => "RedoNode".to_string(),
126 => "RegularExpressionNode".to_string(),
127 => "RequiredKeywordParameterNode".to_string(),
128 => "RequiredParameterNode".to_string(),
129 => "RescueModifierNode".to_string(),
130 => "RescueNode".to_string(),
131 => "RestParameterNode".to_string(),
132 => "RetryNode".to_string(),
133 => "ReturnNode".to_string(),
134 => "SelfNode".to_string(),
135 => "ShareableConstantNode".to_string(),
136 => "SingletonClassNode".to_string(),
137 => "SourceEncodingNode".to_string(),
138 => "SourceFileNode".to_string(),
139 => "SourceLineNode".to_string(),
140 => "SplatNode".to_string(),
141 => "StatementsNode".to_string(),
142 => "StringNode".to_string(),
143 => "SuperNode".to_string(),
144 => "SymbolNode".to_string(),
145 => "TrueNode".to_string(),
146 => "UndefNode".to_string(),
147 => "UnlessNode".to_string(),
148 => "UntilNode".to_string(),
149 => "WhenNode".to_string(),
150 => "WhileNode".to_string(),
151 => "XStringNode".to_string(),
152 => "YieldNode".to_string(),
_ => "Unknown".to_string(),
}
}