in codegen/syntax/SwitchStatement.hack [48:135]
public static function fromJSON(
dict<arraykey, mixed> $json,
string $file,
int $initial_offset,
string $source,
string $_type_hint,
): this {
$offset = $initial_offset;
$keyword = Node::fromJSON(
($json['switch_keyword']) as dict<_, _>,
$file,
$offset,
$source,
'SwitchToken',
);
$keyword = $keyword as nonnull;
$offset += $keyword->getWidth();
$left_paren = Node::fromJSON(
($json['switch_left_paren']) as dict<_, _>,
$file,
$offset,
$source,
'LeftParenToken',
);
$left_paren = $left_paren as nonnull;
$offset += $left_paren->getWidth();
$expression = Node::fromJSON(
($json['switch_expression']) as dict<_, _>,
$file,
$offset,
$source,
'IExpression',
);
$expression = $expression as nonnull;
$offset += $expression->getWidth();
$right_paren = Node::fromJSON(
($json['switch_right_paren']) as dict<_, _>,
$file,
$offset,
$source,
'RightParenToken',
);
$right_paren = $right_paren as nonnull;
$offset += $right_paren->getWidth();
$left_brace = Node::fromJSON(
($json['switch_left_brace']) as dict<_, _>,
$file,
$offset,
$source,
'LeftBraceToken',
);
$left_brace = $left_brace as nonnull;
$offset += $left_brace->getWidth();
$sections = Node::fromJSON(
($json['switch_sections']) as dict<_, _>,
$file,
$offset,
$source,
'NodeList<SwitchSection>',
);
$sections = $sections as nonnull;
$offset += $sections->getWidth();
$right_brace = Node::fromJSON(
($json['switch_right_brace']) as dict<_, _>,
$file,
$offset,
$source,
'RightBraceToken',
);
$right_brace = $right_brace as nonnull;
$offset += $right_brace->getWidth();
$source_ref = shape(
'file' => $file,
'source' => $source,
'offset' => $initial_offset,
'width' => $offset - $initial_offset,
);
return new static(
/* HH_IGNORE_ERROR[4110] */ $keyword,
/* HH_IGNORE_ERROR[4110] */ $left_paren,
/* HH_IGNORE_ERROR[4110] */ $expression,
/* HH_IGNORE_ERROR[4110] */ $right_paren,
/* HH_IGNORE_ERROR[4110] */ $left_brace,
/* HH_IGNORE_ERROR[4110] */ $sections,
/* HH_IGNORE_ERROR[4110] */ $right_brace,
$source_ref,
);
}