Skip to main content

Crate graphix_compiler

Crate graphix_compiler 

Source

Modules§

env
expr
node
typ

Macros§

bailat
Compile-time bail! that attaches an ErrorContext carrying the expression’s Origin and SourcePosition. The LSP recovers both by downcasting ErrorContext out of the anyhow chain — no message-string scraping. Use this instead of bail!("at {} …", spec.pos) in compile paths where the spec Expr is in scope.
defetyp
deref_typ
err
errf
tdbg
update_args
wrap

Structs§

AbstractTypeRegistry
A registry of abstract type UUIDs used by graphix and graphix libraries, along with a string tag describing what the type is. We must do this because you can’t register different type ids with the same uuid in netidx’s abstract type system, and because abstract types often need to be parameterized by the Rt and UserEvent they will have different a different type id for each monomorphization, and thus they must have a different uuid.
BindId
Event
Event represents all the things that happened simultaneously in a given execution cycle. Event may contain only one update for each variable and netidx subscription in a given cycle, if more updates happen simultaneously they must be queued and deferred to later cycles.
ExecCtx
LambdaId
LibState
ModuleInternalView
Per-module snapshot of the internal env (the impl’s view, where implementation bindings shadow sig proxies). The CheckResult’s top-level env is the external view across the project; this per-module entry lets IDE queries on names inside a module reach the impl bind metadata. Only populated when env.lsp_mode is set.
ModuleRefSite
A textual occurrence of a module reference (either use foo; or mod foo;). For the mod foo; case def_ori points at the file the module’s body was loaded from — that’s the natural target for go-to-definition on a module name.
NoUserEvent
ReferenceSite
A textual occurrence of a name at a specific source position that the compiler resolved to a particular BindId. Populated as a side effect of compilation so IDE tooling can answer textDocument/references and textDocument/definition without re-implementing name resolution.
Refs
Scope
ScopeMapEntry
One entry in the per-compile scope map: the compiler descended into an Expr at this (pos, ori) while in this scope. IDE tooling answers cursor → scope by finding the entry with the greatest pos ≤ the cursor in the same file.
SigImplLink
Maps a val foo: T declaration in a .gxi interface to its let foo = … implementation site in the paired .gx. Populated by check_sig whenever it matches a sig proxy bind to its impl bind. Used by IDE tooling to (a) goto-def from a sig val site to the impl, and (b) union find-references results across both BindIds. Only populated when env.lsp_mode is set.
SourcePosition
Struct which represents a position in a source file.
TypeRefSite
A textual occurrence of a type reference (e.g. Foo in let x: Foo). Captured by the compiler when a Type::Ref carrying parse-time position info gets dereferenced. def_pos/def_ori point at the type Foo = … declaration site so go-to-def on a type name lands on the typedef.

Enums§

CFlag
PrintFlag
TypecheckPhase
Phase indicator for Apply::typecheck

Statics§

CBATCH_POOL
global pool of channel watch batches
MODULE_REF_SITE_POOL
REFERENCE_SITE_POOL
Pools backing the IDE side-channel collections. GPooled so the buffers can return to the same pool after crossing the runtime-task → LSP-thread boundary as part of CheckResult. Sized generously since the LSP recompiles on every keystroke and these can grow into the tens of thousands of entries on large modules.
SCOPE_MAP_ENTRY_POOL

Traits§

Abortable
Apply
Apply is a kind of node that represents a function application. It does not hold ownership of it’s arguments, instead those are held by a CallSite node. This allows us to change the function called at runtime without recompiling the arguments.
BuiltIn
Trait implemented by graphix built-in functions implemented in rust. This trait isn’t meant to be implemented manually, use derive(BuiltIn) from the graphix-derive crate
CustomBuiltinType
Rt
Update
Update represents a regular graph node, as opposed to a function application represented by Apply. Regular graph nodes are used for every built in node except for builtin functions.
UserEvent

Functions§

compile
compile the expression into a node graph in the specified context and scope, return the root node or an error if compilation failed.
format_with_flags
For the duration of the closure F change the way type variables are formatted (on this thread only) according to the specified flags.
set_trace
trace
with_trace

Type Aliases§

BuiltInInitFn
InitFn
Node