Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
6 changes: 3 additions & 3 deletions src/v4/compiler/00_compile.dag
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import v4.std.diagnostic {
ExternalContractUnknown,
Locus,
Outcome,
PortLocus,
port_locus,
Rejected,
Unavailable,
bind_outcome,
Expand Down Expand Up @@ -217,7 +217,7 @@ fn compile_inferred(
Eval { host_interp: _ } =>
outcome_rejected(
compile_eval_not_realized_diagnostic(
at: PortLocus { port: compile_stage_locus_port }
at: port_locus(port: compile_stage_locus_port)
)
)
}
Expand Down Expand Up @@ -290,7 +290,7 @@ fn compile_ingest_staging(source: Source, target: TargetModel) -> Outcome<Target
Rejected {
diagnostics: diagnostics_singleton(
d: compile_pipeline_not_realized_diagnostic(
at: PortLocus { port: compile_stage_locus_port }
at: port_locus(port: compile_stage_locus_port)
)
)
}
Expand Down
6 changes: 2 additions & 4 deletions src/v4/compiler/02_parse.dag
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module v4.compiler.parse


import v4.compiler.tokenize { TokenStream }
import v4.std.diagnostic {Correction, Diagnostic, ExternalContractUnknown, Locus, Outcome, PortLocus, UserInputBoundary, Accepted, None, diagnostics_singleton}
import v4.std.diagnostic {Correction, Diagnostic, ExternalContractUnknown, Locus, Outcome, port_locus, UserInputBoundary, Accepted, None, diagnostics_singleton}
import v4.std.node { Atom, Conj, Edge, Named, Node, Symbol, TypeNode, well_formed }


Expand Down Expand Up @@ -210,9 +210,7 @@ fn grammar_to_node(grammar: Grammar) -> Node {


fn parse(tokens: TokenStream, grammar: Grammar) -> Outcome<ParseTree> {
let at = PortLocus {
port: parse_stage_locus_port
}
let at = port_locus(port: parse_stage_locus_port)
let ntok = count(tokens.tokens)
let grammar_node = grammar_to_node(grammar: grammar)
if !well_formed(n: grammar_node) {
Expand Down
6 changes: 3 additions & 3 deletions src/v4/compiler/03_normalize.dag
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import v4.extdeps.languages.dag {
}
import v4.std.diagnostic {
Diagnostic,
NodeLocus,
node_locus,
Outcome,
UserInputBoundary,
Accepted,
Expand Down Expand Up @@ -93,7 +93,7 @@ fn classify_sugar(n: Node) -> SurfaceSugarKind? {
fn malformed_sugar_diagnostic(n: Node) -> Diagnostic {
Diagnostic {
reason: normalize_reason_malformed_sugar,
at: NodeLocus { node: n },
at: node_locus(node: n),
correction: Unavailable { reason: UserInputBoundary }
}
}
Expand All @@ -102,7 +102,7 @@ fn malformed_sugar_diagnostic(n: Node) -> Diagnostic {
fn post_normalize_not_well_formed_diagnostic(n: Node) -> Diagnostic {
Diagnostic {
reason: normalize_reason_post_normalize_not_well_formed,
at: NodeLocus { node: n },
at: node_locus(node: n),
correction: Unavailable { reason: UserInputBoundary }
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/v4/compiler/03_resolve.dag
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import v4.extdeps.languages.dag {
import v4.std.collection { Set }
import v4.std.diagnostic {
Diagnostic,
NodeLocus,
node_locus,
Outcome,
UserInputBoundary,
Accepted,
Expand Down Expand Up @@ -217,7 +217,7 @@ fn lookup_chain(s: Scope, name: Symbol) -> Symbol? {
fn malformed_tree_diagnostic(n: Node) -> Diagnostic {
Diagnostic {
reason: resolve_reason_malformed_tree,
at: NodeLocus { node: n },
at: node_locus(node: n),
correction: Unavailable { reason: UserInputBoundary }
}
}
Expand All @@ -226,7 +226,7 @@ fn malformed_tree_diagnostic(n: Node) -> Diagnostic {
fn unbound_symbol_diagnostic(n: Node) -> Diagnostic {
Diagnostic {
reason: resolve_reason_unbound_symbol,
at: NodeLocus { node: n },
at: node_locus(node: n),
correction: Unavailable { reason: UserInputBoundary }
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/v4/compiler/04_infer.dag
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import v4.std.constraints {
import v4.std.diagnostic {
Diagnostic,
ExternalContractUnknown,
NodeLocus,
node_locus,
Outcome,
Unavailable,
Accepted,
Expand Down Expand Up @@ -106,14 +106,14 @@ data infer_canonical_grounding_incoherent: Symbol = infer_canonical_grounding_in
fn infer_facts_lookup_miss_diagnostic(key: Node) -> Diagnostic {
Diagnostic {
reason: infer_facts_lookup_miss,
at: NodeLocus { node: key },
at: node_locus(node: key),
correction: Unavailable { reason: ExternalContractUnknown }
}
}
fn infer_canonical_grounding_incoherent_diagnostic(node: Node) -> Diagnostic {
Diagnostic {
reason: infer_canonical_grounding_incoherent,
at: NodeLocus { node: node },
at: node_locus(node: node),
correction: Unavailable { reason: ExternalContractUnknown }
}
}
Expand All @@ -122,7 +122,7 @@ fn infer_canonical_grounding_incoherent_diagnostic(node: Node) -> Diagnostic {
fn infer_descent_not_derived_diagnostic(n: Node) -> Diagnostic {
Diagnostic {
reason: infer_descent_not_derived,
at: NodeLocus { node: n },
at: node_locus(node: n),
correction: Unavailable { reason: ExternalContractUnknown }
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/v4/compiler/05_emit.dag
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import v4.std.diagnostic {
Accepted,
Diagnostic,
ExternalContractUnknown,
NodeLocus,
node_locus,
Outcome,
Rejected,
Unavailable,
Expand All @@ -46,7 +46,7 @@ data emit_serialize_emitted_mismatch: Symbol = emit_serialize_emitted_mismatch
fn emit_serialize_emitted_mismatch_diagnostic(emitted: Node, target: TargetModel) -> Diagnostic {
Diagnostic {
reason: emit_serialize_emitted_mismatch,
at: NodeLocus { node: emitted },
at: node_locus(node: emitted),
correction: Unavailable { reason: ExternalContractUnknown }
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/v4/compiler/05_eval.dag
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import v4.std.diagnostic {
Correction,
Diagnostic,
NoCorrectionReason,
NodeLocus,
node_locus,
Outcome,
Unavailable,
Accepted,
Expand Down Expand Up @@ -182,7 +182,7 @@ data eval_rejected_canonical_mismatch: Symbol = eval_rejected_canonical_mismatch
fn eval_diagnostic(reason: Symbol, node: Node) -> Diagnostic {
Diagnostic {
reason: reason,
at: NodeLocus { node: node },
at: node_locus(node: node),
correction: Unavailable { reason: AmbiguousIntent }
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/v4/compiler/06_translate.dag
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ import v4.std.diagnostic {
Accepted,
Diagnostic,
ExternalContractUnknown,
NodeLocus,
node_locus,
Outcome,
PortLocus,
port_locus,
Rejected,
Unavailable,
bind_outcome,
Expand Down Expand Up @@ -78,7 +78,7 @@ data translate_child_reattachment_not_realized: Symbol = translate_child_reattac
fn translate_target_bundle_malformed_diagnostic(target: TargetModel) -> Diagnostic {
Diagnostic {
reason: translate_target_bundle_malformed,
at: NodeLocus { node: target },
at: node_locus(node: target),
correction: Unavailable { reason: ExternalContractUnknown }
}
}
Expand All @@ -88,7 +88,7 @@ fn translate_target_bundle_duplicate_edge_diagnostic(
) -> Diagnostic {
Diagnostic {
reason: translate_target_bundle_duplicate_edge,
at: NodeLocus { node: target },
at: node_locus(node: target),
correction: Unavailable { reason: ExternalContractUnknown }
}
}
Expand Down Expand Up @@ -125,14 +125,14 @@ fn target_bundle_child_lookup_step(
fn translate_target_source_not_realized_diagnostic() -> Diagnostic {
Diagnostic {
reason: translate_target_source_not_realized,
at: PortLocus { port: translate_stage_locus_port },
at: port_locus(port: translate_stage_locus_port),
correction: Unavailable { reason: ExternalContractUnknown }
}
}
fn translate_child_reattachment_not_realized_diagnostic(parent: Node) -> Diagnostic {
Diagnostic {
reason: translate_child_reattachment_not_realized,
at: NodeLocus { node: parent },
at: node_locus(node: parent),
correction: Unavailable { reason: ExternalContractUnknown }
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/v4/compiler/self_host.dag
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import v4.std.collection { List }
import v4.std.diagnostic {
Diagnostic,
ExternalContractUnknown,
NodeLocus,
node_locus,
Outcome,
PortLocus,
port_locus,
Rejected,
Unavailable,
diagnostics_singleton
Expand Down Expand Up @@ -76,7 +76,7 @@ data fixed_point_not_realized: Symbol = fixed_point_not_realized
fn self_host_runner_not_realized_diagnostic() -> Diagnostic {
Diagnostic {
reason: self_host_runner_not_realized,
at: PortLocus { port: self_host_runner_port },
at: port_locus(port: self_host_runner_port),
correction: Unavailable { reason: ExternalContractUnknown }
}
}
Expand Down Expand Up @@ -106,7 +106,7 @@ fn bootstrap_roundtrip_scaffold(
Violates {
diagnostic: Diagnostic {
reason: bootstrap_roundtrip_not_realized,
at: NodeLocus { node: expected_stage },
at: node_locus(node: expected_stage),
correction: Unavailable { reason: ExternalContractUnknown }
}
}
Expand All @@ -120,7 +120,7 @@ fn fixed_point_scaffold(
Violates {
diagnostic: Diagnostic {
reason: fixed_point_not_realized,
at: NodeLocus { node: reference_stage },
at: node_locus(node: reference_stage),
correction: Unavailable { reason: ExternalContractUnknown }
}
}
Expand All @@ -134,7 +134,7 @@ fn stage_emission_equality_scaffold(
Violates {
diagnostic: Diagnostic {
reason: stage_emission_equality_not_realized,
at: NodeLocus { node: reference_stage1 },
at: node_locus(node: reference_stage1),
correction: Unavailable { reason: ExternalContractUnknown }
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/v4/lens/affected_set_examples.dag
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module v4.lens.affected_set_examples

import v4.std.diagnostic {
Diagnostic,
NodeLocus,
node_locus,
Unavailable,
ExternalContractUnknown,
diagnostics_singleton
Expand Down Expand Up @@ -52,7 +52,7 @@ data affected_set_example_edit: Edit = Edit {

data affected_set_example_invalid_edit_diagnostic: Diagnostic = Diagnostic {
reason: affected_set_example_reason,
at: NodeLocus { node: affected_set_example_node },
at: node_locus(node: affected_set_example_node),
correction: Unavailable { reason: ExternalContractUnknown }
}

Expand Down
4 changes: 2 additions & 2 deletions src/v4/lens/cost.dag
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import v4.std.cardinality { NonZeroNat }
import v4.std.diagnostic {
AmbiguousIntent,
Diagnostic,
NodeLocus,
node_locus,
Unavailable
}
import v4.std.node {
Expand Down Expand Up @@ -176,7 +176,7 @@ fn unknown_cost(reason: String) -> SymbolicCost {
fn symbolic_cost_diagnostic(n: Node) -> Diagnostic {
Diagnostic {
reason: cost_reason_unmodeled_symbolic_cost,
at: NodeLocus { node: n },
at: node_locus(node: n),
correction: Unavailable { reason: AmbiguousIntent }
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/v4/std/coercion.dag
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import v4.std.diagnostic {
Diagnostic,
ExternalContractUnknown,
None,
NodeLocus,
node_locus,
Outcome,
Rejected,
Unavailable,
Expand Down Expand Up @@ -82,7 +82,7 @@ fn coercion_not_realized_diagnostic(
) -> Diagnostic {
Diagnostic {
reason: coercion_mismatch_reason(kind: kind),
at: NodeLocus { node: source.node },
at: node_locus(node: source.node),
correction: Unavailable { reason: ExternalContractUnknown }
}
}
Expand Down Expand Up @@ -116,7 +116,7 @@ fn declared_inhabitant_candidates(inhabitants_root: Node) -> List<Node> {
fn coercion_candidate_set_not_closed_diagnostic(inhabitants_root: Node) -> Diagnostic {
Diagnostic {
reason: coercion_mismatch_candidate_set_not_closed,
at: NodeLocus { node: inhabitants_root },
at: node_locus(node: inhabitants_root),
correction: Unavailable { reason: ExternalContractUnknown }
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/v4/std/constraints.dag
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import v4.std.diagnostic {
Accepted,
Diagnostic,
ExternalContractUnknown,
NodeLocus,
node_locus,
None,
Outcome,
Rejected,
Expand Down Expand Up @@ -65,14 +65,14 @@ type CanonicalGroundingWitness {
fn constraints_not_realized_diagnostic(graph: ConstraintGraph) -> Diagnostic {
Diagnostic {
reason: constraints_not_realized,
at: NodeLocus { node: graph.root },
at: node_locus(node: graph.root),
correction: Unavailable { reason: ExternalContractUnknown }
}
}
fn constraints_ill_formed_root_diagnostic(graph: ConstraintGraph) -> Diagnostic {
Diagnostic {
reason: constraints_ill_formed_root,
at: NodeLocus { node: graph.root },
at: node_locus(node: graph.root),
correction: Unavailable { reason: ExternalContractUnknown }
}
}
Expand Down
Loading
Loading