Skip to content

Commit

Permalink
Do a run of rustgen on master
Browse files Browse the repository at this point in the history
Summary: Do a run of rustgen on master to capture stuff that was missing.

Reviewed By: avp

Differential Revision: D66270765

fbshipit-source-id: 2b33e428f0dab7e8e7e356f81416477913a59cdd
  • Loading branch information
gkz authored and facebook-github-bot committed Nov 21, 2024
1 parent 662354b commit eacee79
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 3 deletions.
15 changes: 14 additions & 1 deletion unsupported/juno/crates/hermes/src/parser/generated_ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,19 @@ pub enum NodeKind {
TypeParameterInstantiation,
TypeCastExpression,
AsExpression,
AsConstExpression,
InferredPredicate,
DeclaredPredicate,
EnumDeclaration,
EnumStringBody,
EnumNumberBody,
EnumBigIntBody,
EnumBooleanBody,
EnumSymbolBody,
EnumDefaultedMember,
EnumStringMember,
EnumNumberMember,
EnumBigIntMember,
EnumBooleanMember,
ComponentParameter,
_FlowLast,
Expand Down Expand Up @@ -655,6 +658,7 @@ extern "C" {
pub fn hermes_get_QualifiedTypeofIdentifier_id(node: NodePtr) -> NodePtr;
// TupleTypeAnnotation
pub fn hermes_get_TupleTypeAnnotation_types(node: NodePtr) -> NodeListRef;
pub fn hermes_get_TupleTypeAnnotation_inexact(node: NodePtr) -> bool;
// TupleTypeSpreadElement
pub fn hermes_get_TupleTypeSpreadElement_label(node: NodePtr) -> NodePtrOpt;
pub fn hermes_get_TupleTypeSpreadElement_typeAnnotation(node: NodePtr) -> NodePtr;
Expand Down Expand Up @@ -689,7 +693,7 @@ extern "C" {
// TypePredicate
pub fn hermes_get_TypePredicate_parameterName(node: NodePtr) -> NodePtr;
pub fn hermes_get_TypePredicate_typeAnnotation(node: NodePtr) -> NodePtrOpt;
pub fn hermes_get_TypePredicate_asserts(node: NodePtr) -> bool;
pub fn hermes_get_TypePredicate_kind(node: NodePtr) -> NodeStringOpt;
// InterfaceTypeAnnotation
pub fn hermes_get_InterfaceTypeAnnotation_extends(node: NodePtr) -> NodeListRef;
pub fn hermes_get_InterfaceTypeAnnotation_body(node: NodePtr) -> NodePtrOpt;
Expand Down Expand Up @@ -825,6 +829,8 @@ extern "C" {
// AsExpression
pub fn hermes_get_AsExpression_expression(node: NodePtr) -> NodePtr;
pub fn hermes_get_AsExpression_typeAnnotation(node: NodePtr) -> NodePtr;
// AsConstExpression
pub fn hermes_get_AsConstExpression_expression(node: NodePtr) -> NodePtr;
// DeclaredPredicate
pub fn hermes_get_DeclaredPredicate_value(node: NodePtr) -> NodePtr;
// EnumDeclaration
Expand All @@ -838,6 +844,10 @@ extern "C" {
pub fn hermes_get_EnumNumberBody_members(node: NodePtr) -> NodeListRef;
pub fn hermes_get_EnumNumberBody_explicitType(node: NodePtr) -> bool;
pub fn hermes_get_EnumNumberBody_hasUnknownMembers(node: NodePtr) -> bool;
// EnumBigIntBody
pub fn hermes_get_EnumBigIntBody_members(node: NodePtr) -> NodeListRef;
pub fn hermes_get_EnumBigIntBody_explicitType(node: NodePtr) -> bool;
pub fn hermes_get_EnumBigIntBody_hasUnknownMembers(node: NodePtr) -> bool;
// EnumBooleanBody
pub fn hermes_get_EnumBooleanBody_members(node: NodePtr) -> NodeListRef;
pub fn hermes_get_EnumBooleanBody_explicitType(node: NodePtr) -> bool;
Expand All @@ -853,6 +863,9 @@ extern "C" {
// EnumNumberMember
pub fn hermes_get_EnumNumberMember_id(node: NodePtr) -> NodePtr;
pub fn hermes_get_EnumNumberMember_init(node: NodePtr) -> NodePtr;
// EnumBigIntMember
pub fn hermes_get_EnumBigIntMember_id(node: NodePtr) -> NodePtr;
pub fn hermes_get_EnumBigIntMember_init(node: NodePtr) -> NodePtr;
// EnumBooleanMember
pub fn hermes_get_EnumBooleanMember_id(node: NodePtr) -> NodePtr;
pub fn hermes_get_EnumBooleanMember_init(node: NodePtr) -> NodePtr;
Expand Down
39 changes: 37 additions & 2 deletions unsupported/juno/crates/juno/src/hparser/generated_cvt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1465,9 +1465,11 @@ pub unsafe fn cvt_node_ptr<'parser, 'gc>(
}
NodeKind::TupleTypeAnnotation => {
let types = cvt_node_list(cvt, gc, hermes_get_TupleTypeAnnotation_types(n));
let inexact = hermes_get_TupleTypeAnnotation_inexact(n);
let mut template = ast::template::TupleTypeAnnotation {
metadata: ast::TemplateMetadata {range, ..Default::default()},
types,
inexact,
};
template.metadata.range.end = if nr.source_range.is_empty() { template.metadata.range.start } else { cvt.cvt_smloc(nr.source_range.end.pred()) };
ast::builder::TupleTypeAnnotation::build_template(gc, template)
Expand Down Expand Up @@ -1587,12 +1589,12 @@ pub unsafe fn cvt_node_ptr<'parser, 'gc>(
NodeKind::TypePredicate => {
let parameter_name = cvt_node_ptr(cvt, gc, hermes_get_TypePredicate_parameterName(n));
let type_annotation = cvt_node_ptr_opt(cvt, gc, hermes_get_TypePredicate_typeAnnotation(n));
let asserts = hermes_get_TypePredicate_asserts(n);
let kind = cvt.cvt_string_opt(gc, hermes_get_TypePredicate_kind(n));
let mut template = ast::template::TypePredicate {
metadata: ast::TemplateMetadata {range, ..Default::default()},
parameter_name,
type_annotation,
asserts,
kind,
};
template.metadata.range.end = if nr.source_range.is_empty() { template.metadata.range.start } else { cvt.cvt_smloc(nr.source_range.end.pred()) };
ast::builder::TypePredicate::build_template(gc, template)
Expand Down Expand Up @@ -2037,6 +2039,15 @@ pub unsafe fn cvt_node_ptr<'parser, 'gc>(
template.metadata.range.end = if nr.source_range.is_empty() { template.metadata.range.start } else { cvt.cvt_smloc(nr.source_range.end.pred()) };
ast::builder::AsExpression::build_template(gc, template)
}
NodeKind::AsConstExpression => {
let expression = cvt_node_ptr(cvt, gc, hermes_get_AsConstExpression_expression(n));
let mut template = ast::template::AsConstExpression {
metadata: ast::TemplateMetadata {range, ..Default::default()},
expression,
};
template.metadata.range.end = if nr.source_range.is_empty() { template.metadata.range.start } else { cvt.cvt_smloc(nr.source_range.end.pred()) };
ast::builder::AsConstExpression::build_template(gc, template)
}
NodeKind::InferredPredicate => {
let mut template = ast::template::InferredPredicate {
metadata: ast::TemplateMetadata {range, ..Default::default()},
Expand Down Expand Up @@ -2090,6 +2101,19 @@ pub unsafe fn cvt_node_ptr<'parser, 'gc>(
template.metadata.range.end = if nr.source_range.is_empty() { template.metadata.range.start } else { cvt.cvt_smloc(nr.source_range.end.pred()) };
ast::builder::EnumNumberBody::build_template(gc, template)
}
NodeKind::EnumBigIntBody => {
let members = cvt_node_list(cvt, gc, hermes_get_EnumBigIntBody_members(n));
let explicit_type = hermes_get_EnumBigIntBody_explicitType(n);
let has_unknown_members = hermes_get_EnumBigIntBody_hasUnknownMembers(n);
let mut template = ast::template::EnumBigIntBody {
metadata: ast::TemplateMetadata {range, ..Default::default()},
members,
explicit_type,
has_unknown_members,
};
template.metadata.range.end = if nr.source_range.is_empty() { template.metadata.range.start } else { cvt.cvt_smloc(nr.source_range.end.pred()) };
ast::builder::EnumBigIntBody::build_template(gc, template)
}
NodeKind::EnumBooleanBody => {
let members = cvt_node_list(cvt, gc, hermes_get_EnumBooleanBody_members(n));
let explicit_type = hermes_get_EnumBooleanBody_explicitType(n);
Expand Down Expand Up @@ -2145,6 +2169,17 @@ pub unsafe fn cvt_node_ptr<'parser, 'gc>(
template.metadata.range.end = if nr.source_range.is_empty() { template.metadata.range.start } else { cvt.cvt_smloc(nr.source_range.end.pred()) };
ast::builder::EnumNumberMember::build_template(gc, template)
}
NodeKind::EnumBigIntMember => {
let id = cvt_node_ptr(cvt, gc, hermes_get_EnumBigIntMember_id(n));
let init = cvt_node_ptr(cvt, gc, hermes_get_EnumBigIntMember_init(n));
let mut template = ast::template::EnumBigIntMember {
metadata: ast::TemplateMetadata {range, ..Default::default()},
id,
init,
};
template.metadata.range.end = if nr.source_range.is_empty() { template.metadata.range.start } else { cvt.cvt_smloc(nr.source_range.end.pred()) };
ast::builder::EnumBigIntMember::build_template(gc, template)
}
NodeKind::EnumBooleanMember => {
let id = cvt_node_ptr(cvt, gc, hermes_get_EnumBooleanMember_id(n));
let init = cvt_node_ptr(cvt, gc, hermes_get_EnumBooleanMember_init(n));
Expand Down

0 comments on commit eacee79

Please sign in to comment.