Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/v1/stage0/src/extdeps_container_oci_digest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ pub use crate::extdeps_external_authority::{
};
use crate::extdeps_uri::UriScheme::Https;
pub use crate::extdeps_uri::{Uri, UriScheme};
pub use crate::std_content_hash::Sha512DigestHex;
pub use crate::std_content_hash::{sha256_hex_digest, sha512_hex_digest};
pub use crate::std_content_hash::{Sha256Digest, Sha512Digest};
use crate::std_decl_ref::DeclField::WholeDeclaration;
Expand Down
1 change: 1 addition & 0 deletions src/v1/stage0/src/v1_compiler_compile.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Generated by v1 compiler -- do not edit.
// Source module: v1.compiler.compile

pub use crate::std_algebra::FreeMonoid;
pub use crate::std_computation::ShrinkFactor;
use crate::std_computation::ShrinkFactor::{ConstantShrink, ProportionalShrink, UnitShrink};
use crate::std_induction::RecursionShape::{
Expand Down
2 changes: 2 additions & 0 deletions src/v1/stage0/src/v1_compiler_complexity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ pub use crate::v1_compiler_parse::{
pub use crate::v1_compiler_parse::{ParserCallIdentity, ParserResultWitness};
use crate::v1_rt;
use crate::v1_rt::{VecCompat, VecJoin};
pub use crate::v1_std_core::Cardinality;
use crate::v1_std_core::Cardinality::*;
use crate::v1_std_core::ExprData::{
ExprBinOp, ExprBlock, ExprCall, ExprError, ExprFieldAccess, ExprForEach, ExprIf, ExprLambda,
ExprLet, ExprLiteral, ExprMatch, ExprMethodCall, ExprRecordLit, ExprReturn, ExprUnaryOp,
Expand Down
2 changes: 2 additions & 0 deletions src/v1/stage0/src/v1_compiler_dag_collect.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Generated by v1 compiler -- do not edit.
// Source module: v1.compiler.dag_collect

pub use crate::std_syntax::BinOp;
use crate::std_syntax::BinOp::*;
pub use crate::v1_compiler_dag_collect_support::{
dag_collect_fp_memo_reset, dag_collect_pack_slots, dag_collect_slot_seq,
dag_node_surface_fingerprint, dag_node_surface_fingerprint_memo,
Expand Down
135 changes: 78 additions & 57 deletions src/v1/stage0/src/v1_compiler_emit_rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ pub use crate::v1_compiler_infer_types::{
is_unit_like, node_is_collection, node_is_element_collection, node_is_keyed_collection,
node_is_set_collection, normalize_access_type_node, resolved_type,
};
pub use crate::v1_compiler_languages::NamingCase;
use crate::v1_compiler_languages::NamingCase::*;
use crate::v1_compiler_languages::VisibilitySpec::KeywordVisibility;
pub use crate::v1_compiler_languages::{
is_string_like, scaffold_for_target, serialization_for_target, sharing_for_target,
Expand All @@ -106,6 +108,8 @@ pub use crate::v1_compiler_languages::{
visibility_for_target, wrap_shared_type,
};
pub use crate::v1_compiler_languages::{ItemKeywords, TestConventions, VisibilitySpec};
pub use crate::v1_compiler_ownership::EdgeKind;
use crate::v1_compiler_ownership::EdgeKind::*;
pub use crate::v1_compiler_ownership::OwnershipProof;
pub use crate::v1_compiler_ownership::{
analyze_ownership, analyze_single_fold, build_movable_set, build_read_only_params,
Expand Down Expand Up @@ -6935,11 +6939,21 @@ pub fn collect_value_emit_type_surface_names(
emit_info.clone(),
),
_ => {
let from_inferred = emit_inferred_type_leaf_name(n.clone(), source_indices.clone());
let from_inferred_list = if (from_inferred.clone() != "".to_string()) {
Rc::new(vec![from_inferred.clone()])
} else {
Rc::new(vec![])
let from_inferred_list = match n.inferred.clone().as_deref().cloned() {
Some(InferredNode::Resolved { node: rt, .. }) => {
let is_optional =
(rt.return_cardinality.clone() == Cardinality::CardOptional);
let peeled_rt = if is_optional.clone() {
with_required_cardinality(rt.clone())
} else {
rt.clone()
};
collect_type_node_import_surface_names(
peeled_rt.clone(),
source_indices.clone(),
)
}
_ => Rc::new(vec![]),
};
let nm = authored_name_at(source_indices.clone(), n.clone());
let from_variant = match v1_rt::map_get(&variant_to_enum, nm.clone()) {
Expand Down Expand Up @@ -22755,63 +22769,70 @@ pub fn emit_rust_generic_method_call(
)
}
} else {
{
let recv_str = if rust_runtime_bridge_passes_receiver_by_ref(function_name.clone())
if (v1_rt::map_contains_key(&rt_functions(), function_name.clone()) == false) {
{
v1_rt::concat(
"&".to_string(),
emit_typed_expr_base(
receiver.clone(),
registry.clone(),
scope.clone(),
depth.clone(),
shared_types.clone(),
emit_info.clone(),
),
)
} else {
emit_cloned_arg(
receiver.clone(),
registry.clone(),
scope.clone(),
depth.clone(),
shared_types.clone(),
emit_info.clone(),
)
};
let arg_strs = Rc::new({
let mut __result = Vec::new();
for a in args.clone().iter().cloned() {
__result.push(emit_cloned_arg(
arg_value(a.clone()),
registry.clone(),
scope.clone(),
depth.clone(),
shared_types.clone(),
emit_info.clone(),
));
}
__result
});
let all_strs = v1_rt::concat(Rc::new(vec![recv_str.clone()]), arg_strs.clone());
let bridge_name = rust_runtime_bridge_name(function_name.clone());
let lowered = v1_rt::concat(
v1_rt::concat(
let spec = language_spec(RenderTarget::Rust);
apply_type_template1(spec.error_type_template.clone(), v1_rt::concat(v1_rt::concat("method ".to_string(), function_name.clone()), " is neither a resolved callable receiver field nor a registered v1_rt bridge function".to_string()))
}
} else {
{
let recv_str =
if rust_runtime_bridge_passes_receiver_by_ref(function_name.clone()) {
v1_rt::concat(
"&".to_string(),
emit_typed_expr_base(
receiver.clone(),
registry.clone(),
scope.clone(),
depth.clone(),
shared_types.clone(),
emit_info.clone(),
),
)
} else {
emit_cloned_arg(
receiver.clone(),
registry.clone(),
scope.clone(),
depth.clone(),
shared_types.clone(),
emit_info.clone(),
)
};
let arg_strs = Rc::new({
let mut __result = Vec::new();
for a in args.clone().iter().cloned() {
__result.push(emit_cloned_arg(
arg_value(a.clone()),
registry.clone(),
scope.clone(),
depth.clone(),
shared_types.clone(),
emit_info.clone(),
));
}
__result
});
let all_strs = v1_rt::concat(Rc::new(vec![recv_str.clone()]), arg_strs.clone());
let bridge_name = rust_runtime_bridge_name(function_name.clone());
let lowered = v1_rt::concat(
v1_rt::concat(
v1_rt::concat(
"v1_rt::".to_string(),
emit_ident(bridge_name.clone(), RenderTarget::Rust),
v1_rt::concat(
"v1_rt::".to_string(),
emit_ident(bridge_name.clone(), RenderTarget::Rust),
),
"(".to_string(),
),
"(".to_string(),
all_strs.clone().join(&", ".to_string()),
),
all_strs.clone().join(&", ".to_string()),
),
")".to_string(),
);
if rust_runtime_bridge_wraps_collection_result_in_rc(function_name.clone()) {
rust_shared_wrap_ctor(lowered.clone())
} else {
lowered.clone()
")".to_string(),
);
if rust_runtime_bridge_wraps_collection_result_in_rc(function_name.clone()) {
rust_shared_wrap_ctor(lowered.clone())
} else {
lowered.clone()
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/v1/stage0/src/v1_compiler_infer_access.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Generated by v1 compiler -- do not edit.
// Source module: v1.compiler.infer_access

pub use crate::std_syntax::BinOp;
use crate::std_syntax::BinOp::*;
pub use crate::std_types::is_ordered_element_collection;
pub use crate::std_types::SourceSpan;
pub use crate::v1_compiler_infer_types::{
Expand Down
2 changes: 2 additions & 0 deletions src/v1/stage0/src/v1_compiler_infer_emit_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use self::TypeRepr::*;
pub use crate::std_dissolution::DissolutionCondition;
use crate::std_dissolution::DissolutionCondition::*;
pub use crate::std_dissolution::{dissolution_description, unbound_dissolution};
pub use crate::std_syntax::BinOp;
use crate::std_syntax::BinOp::*;
pub use crate::v1_compiler_infer_env::TypeEnv;
pub use crate::v1_compiler_infer_env::{empty_symbol_index, empty_type_env};
pub use crate::v1_compiler_infer_types::{
Expand Down
2 changes: 2 additions & 0 deletions src/v1/stage0/src/v1_compiler_infer_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ use crate::std_induction::RecursionShape::{
};
use crate::std_induction::SubValueRelation::{PreservedValue, SubValueUnknown};
pub use crate::std_induction::{InductiveField, RecursionShape, SubValueRelation};
pub use crate::std_syntax::BinOp;
use crate::std_syntax::BinOp::*;
pub use crate::std_types::is_kernel_type;
pub use crate::std_types::SourceSpan;
pub use crate::v1_compiler_infer_occurrence_binding::ModulePathBindingProjection;
Expand Down
6 changes: 6 additions & 0 deletions src/v1/stage0/src/v1_compiler_infer_lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ pub use crate::std_algebra::{
};
pub use crate::std_induction::SubValueRelation;
use crate::std_induction::SubValueRelation::*;
pub use crate::std_syntax::BinOp;
use crate::std_syntax::BinOp::*;
pub use crate::v1_compiler_infer_emit_info::{
build_enum_field_summaries, build_struct_field_summaries,
};
Expand Down Expand Up @@ -45,12 +47,15 @@ use crate::v1_rt;
use crate::v1_rt::{VecCompat, VecJoin};
use crate::v1_std_core::Cardinality::{CardOptional, Required};
use crate::v1_std_core::Connective::{Conj, Disj, NoConnective};
use crate::v1_std_core::ExprData::*;
use crate::v1_std_core::FieldAccessStyle::OptionalUnwrap;
use crate::v1_std_core::FieldValueShape::{OptionalValue, PlainValue};
use crate::v1_std_core::InferredNode::{Resolved, TypeVariable};
use crate::v1_std_core::MatchPattern::*;
use crate::v1_std_core::MethodSemantics::{
AlgebraMethodSemantics, PlainMethodSemantics, ServiceMethodSemantics,
};
use crate::v1_std_core::UnaryOpKind::*;
pub use crate::v1_std_core::{
authored_name_at, error_type, find_child_named, has_child_named, param_node_type_expr,
preserve_outer_optional_cardinality, qualified_last_segment, with_optional_cardinality,
Expand All @@ -60,6 +65,7 @@ pub use crate::v1_std_core::{
Cardinality, Connective, ErrorNode, FieldAccessStyle, FieldSummary, FieldValueShape,
InferredNode, MethodSemantics, NewlineIndex, Node,
};
pub use crate::v1_std_core::{ExprData, MatchPattern, UnaryOpKind};
use crate::NonEmptyBTreeSet;
use crate::NonEmptyVec;
use im::{vector as vec, HashMap, OrdSet as BTreeSet, Vector as Vec};
Expand Down
4 changes: 4 additions & 0 deletions src/v1/stage0/src/v1_compiler_infer_patterns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

use self::NodeLookupStatus::*;
use self::PatternSubject::*;
pub use crate::std_syntax::BinOp;
use crate::std_syntax::BinOp::*;
pub use crate::std_syntax::LiteralValue;
use crate::std_syntax::LiteralValue::LitBool;
use crate::std_syntax::LiteralValue::*;
Expand All @@ -24,6 +26,8 @@ use crate::v1_std_core::Connective::{Disj, NoConnective};
use crate::v1_std_core::ExprData::NoExprData;
use crate::v1_std_core::InferredNode::{CompilerError, Resolved, TypeVariable};
use crate::v1_std_core::MatchPattern::LitPattern;
pub use crate::v1_std_core::UnaryOpKind;
use crate::v1_std_core::UnaryOpKind::*;
pub use crate::v1_std_core::{
arm_pattern, authored_name_at, error_type, find_child_named, generic_param_name_at,
is_compiler_error, kernel_span, make_error_node, no_span, none_type,
Expand Down
2 changes: 2 additions & 0 deletions src/v1/stage0/src/v1_compiler_infer_service.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Generated by v1 compiler -- do not edit.
// Source module: v1.compiler.infer_service

pub use crate::std_syntax::BinOp;
use crate::std_syntax::BinOp::*;
pub use crate::std_types::SourceSpan;
pub use crate::v1_compiler_infer_items::inferred_to_outputs;
use crate::v1_compiler_infer_items::ItemKind::FuncItem;
Expand Down
5 changes: 5 additions & 0 deletions src/v1/stage0/src/v1_compiler_infer_sigs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
use self::FuncSigLookup::*;
pub use crate::std_induction::SubValueRelation;
use crate::std_induction::SubValueRelation::*;
pub use crate::std_syntax::BinOp;
use crate::std_syntax::BinOp::*;
pub use crate::v1_compiler_infer_occurrence_binding::ModulePathBindingProjection;
use crate::v1_compiler_infer_occurrence_binding::ModulePathBindingProjection::*;
pub use crate::v1_compiler_infer_occurrence_binding::{
Expand All @@ -14,10 +16,13 @@ use crate::v1_rt;
use crate::v1_rt::{VecCompat, VecJoin};
use crate::v1_std_core::CompilerDiagnostic::MissingAnnotation;
use crate::v1_std_core::ExprData::ExprCall;
use crate::v1_std_core::InferredNode::*;
use crate::v1_std_core::MatchPattern::*;
pub use crate::v1_std_core::{authored_name_at, expr_call_func_at, make_error_node, no_span};
pub use crate::v1_std_core::{
CompilerDiagnostic, DeclaredFuncSig, ErrorNode, ExprData, NewlineIndex, Node,
};
pub use crate::v1_std_core::{InferredNode, MatchPattern};
use crate::NonEmptyBTreeSet;
use crate::NonEmptyVec;
use im::{vector as vec, HashMap, OrdSet as BTreeSet, Vector as Vec};
Expand Down
2 changes: 2 additions & 0 deletions src/v1/stage0/src/v1_compiler_normalize.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Generated by v1 compiler -- do not edit.
// Source module: v1.compiler.normalize

pub use crate::std_syntax::BinOp;
use crate::std_syntax::BinOp::*;
pub use crate::std_types::container_expected_arity;
pub use crate::v1_compiler_resolve::{ModuleGraph, ResolvedModule};
use crate::v1_rt;
Expand Down
4 changes: 4 additions & 0 deletions src/v1/stage0/src/v1_compiler_ownership.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

use self::EdgeKind::*;
use self::OwnershipDecision::*;
pub use crate::std_syntax::BinOp;
use crate::std_syntax::BinOp::*;
pub use crate::v1_compiler_emit_core_support::to_string;
use crate::v1_rt;
use crate::v1_rt::{VecCompat, VecJoin};
Expand All @@ -12,6 +14,8 @@ use crate::v1_std_core::ExprData::{
ExprLiteral, ExprMatch, ExprMethodCall, ExprRecordLit, ExprReturn, ExprVar, NoExprData,
};
use crate::v1_std_core::InferredNode::Resolved;
pub use crate::v1_std_core::MatchPattern;
use crate::v1_std_core::MatchPattern::*;
use crate::v1_std_core::VarBindingKind::{FunctionValueBinding, LocalValueBinding};
pub use crate::v1_std_core::{
arg_value, arm_body, authored_name_at, expr_call_func_at, expr_method_name_at,
Expand Down
4 changes: 4 additions & 0 deletions src/v1/stage0/src/v1_compiler_resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
// Source module: v1.compiler.resolve

pub use crate::std_occurrence_identity::{OccurrenceIndex, OccurrenceTransport};
pub use crate::std_syntax::BinOp;
use crate::std_syntax::BinOp::*;
pub use crate::std_types::kernel_type_set;
use crate::v1_rt;
use crate::v1_rt::{VecCompat, VecJoin};
use crate::v1_std_core::CompilerDiagnostic::{
CircularDependency, DuplicateModule, MissingExport, UnresolvedImport,
};
use crate::v1_std_core::Connective::{Conj, Disj, NoConnective};
pub use crate::v1_std_core::InferredNode;
use crate::v1_std_core::InferredNode::*;
pub use crate::v1_std_core::{
authored_name_at, import_is_all, import_node, import_specific_names_at, make_error_node,
module_imports, module_items, module_node, no_span,
Expand Down
5 changes: 5 additions & 0 deletions src/v1/stage0/src/v1_compiler_trait_derive_emit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ pub use crate::std_decl_ref::DeclarationRef;
pub use crate::std_dissolution::unbound_dissolution;
pub use crate::std_dissolution::DissolutionCondition;
use crate::std_dissolution::DissolutionCondition::*;
pub use crate::std_syntax::BinOp;
use crate::std_syntax::BinOp::*;
use crate::std_trait_derive_shape::ReprGroundingDeriveElemShape::{
ReprDeriveElemKernelInt, ReprDeriveElemNullaryEnumCopy, ReprDeriveElemPayloadCoproduct,
ReprDeriveElemSymbolWrappedOrdCarrier, ReprDeriveElemUnknown,
Expand All @@ -28,8 +30,11 @@ pub use crate::v1_compiler_infer_types::{child_type_node, is_coproduct_type};
use crate::v1_rt;
use crate::v1_rt::{VecCompat, VecJoin};
use crate::v1_std_core::Connective::NoConnective;
use crate::v1_std_core::MatchPattern::*;
use crate::v1_std_core::UnaryOpKind::*;
pub use crate::v1_std_core::{authored_name_at, generic_param_name_at, param_node_type_expr};
pub use crate::v1_std_core::{Connective, NewlineIndex, Node};
pub use crate::v1_std_core::{MatchPattern, UnaryOpKind};
use crate::NonEmptyBTreeSet;
use crate::NonEmptyVec;
use im::{vector as vec, HashMap, OrdSet as BTreeSet, Vector as Vec};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub use crate::v1_compiler_tokenize::tokenize;
use crate::v1_rt;
use crate::v1_rt::{VecCompat, VecJoin};
pub use crate::v1_std_core::NewlineIndex;
pub use crate::v1_std_core::Token;
pub use crate::v1_std_core::{build_newline_index, empty_intern_table};
use crate::NonEmptyBTreeSet;
use crate::NonEmptyVec;
Expand Down