Skip to content

Dependency Structure

Benedict Albrecht edited this page Jun 2, 2026 · 4 revisions

Dependency Structure

Crodox resolves variables and dependencies using a scoping system that controls visibility between objects.


Variable Scoping Rules

Scope Visibility
:following Forward siblings + own downstream (default)
:down All downstream elements
:siblings All siblings' elements (no downstream)
:up Siblings + downstream + parent. If parent is file → file references
:global Entire file + all referencing files
:hook Any matching variable in the project (cross-file)

Dependency Modifiers

Syntax Creates Dependency Overwrites Variable Notes
title:any Standard behavior
TITLE:any Uppercase - no dependency
'title' Reference - no overwrite
"title" File path - Must match file path bridge definitions
![x|y]title! ✅ (sub-body) - Limits to object types x, y
<-A,B-> One-sided - Child → parent only for types A, B

Children Dependencies

Relationship Default Typed <-A-> File Objects
Parent → Child
Child → Parent


In Practice

The Basics grammar demonstrates several dependency patterns in the Test_Repo:

Source Target Mechanism
testFile.txt bridgeTest2.txt Path variable <<"FROM".txt>> in import
let xxx in F1 variable zzz in C1 Reference <<'name'>> resolves upward
C1.F1(aaa) class C1 Reference <<'name'>>
C1.F1(aaa) function F1 Dependency selection <<![class|function]name!>>
C1.F1(aaa) variable aaa Reference <<'name'>> for the argument
let yyy = eee in F4 parameter eee (F4) :down parameter shadows class-level eee

See Repo Analysis for the full parsed trees and Analysing a Repository for a step-by-step walkthrough.


See also: Variables - Types and scoping · Grammar Structure - File composition

Clone this wiki locally