One builtin: its name, the doge-runtime function a call emits, the argument
counts it accepts, its emission shape, and the call-shape hint for arity
diagnostics.
A single compile error. The front end stops at the first one (docs/ERRORS.md:
“one issue at a time”), so a failed compile yields exactly one Diagnostic.
One callable member of a module: its arity, the runtime function a call emits,
and the call-shape hint shown in arity diagnostics. arity is the required
positional-argument count; optional == true allows exactly one extra trailing
argument, so the accepted range is arity..=arity + 1 (an omitted trailing
argument reaches the runtime function as Value::None).
One formal parameter in a function header: its name and, optionally, a
default value. A default is a literal (docs/SYNTAX.md §6), so it references no
names and is safe to evaluate fresh at every call site.
A function header’s parameters: the fixed/defaulted positional parameters in
order, plus an optional trailing variadic parameter (many rest) that
collects the surplus arguments into a List. Required parameters come first,
then defaulted ones, then the variadic — the parser enforces that order.
The accumulated top-level scope of a REPL session: every name in scope, the
subset that are constants, and the object definitions (for inheritance and
super checks). A snippet is checked as if these were already declared, so it
can reference — and redefine — anything earlier snippets introduced. Built by
the interpreter from its live session state, so the checker and the runtime
always agree on what exists.
The runtime function pack.zoom maps to. Both engines special-case it: the
compiler hands it the pup trampoline plus a globals snapshot, and the
interpreter routes it to its own thread-spawning path instead of the generic
native dispatch. Kept in step with the pack module’s zoom entry below.
Check a REPL snippet against a session’s accumulated scope. Identical to
[check] but with session’s names pre-declared: top-level references to
earlier snippets resolve, and a snippet may redefine a name an earlier one
introduced (only the current snippet is checked for duplicate definitions).
Constant reassignment and undeclared-name use stay errors.
The nested functions defined directly in this scope — crossing if/for/
while/pls blocks (names leak, Python-style) but never another function’s
body. Returns each (name, params, body, span).
Format source (named path for diagnostics) to canonical Doge style, or a
diagnostic if it does not parse. Comments are preserved; the token stream is
never changed.
Every bound name in one scope — such/so declarations, for loop
variables, oh no error names, and nested function definitions — in
first-seen order, each once. These become the scope’s Env fields or hoisted
locals. A nested function’s own body is not descended into: its inner names
belong to its own scope.
Load the entry script and every module it imports into a Program,
resolving so <name> against the stdlib and sibling files only (no project
dependencies).
Parse a REPL snippet. Unlike [parse], the top level does not require a
closing wow, so a clean parse to end-of-input is ReplParse::Complete. A
parse that fails at end-of-input — the snippet was cut off mid-construct —
is ReplParse::Incomplete so the caller can read another line; any failure
at a real token is ReplParse::Error. A leading top-level wow ends the
snippet, so the statements before it parse as complete.
Resolve root’s dependency graph into a DependencyMap. git_dir turns a
git source into a local package directory (fetching or reading a cache); a
path dependency is resolved relative to the package declaring it.
Build a one-file Program from an already-parsed script, resolving imports
against the stdlib only. Used by the single-file generate/check APIs and
the codegen unit tests, where no user modules are on disk to load.
Every package in a resolved project: canonical package-root directory → the
aliases that package declares → the canonical entry .doge file each binds.
The loader finds a file’s owning package by walking its canonical ancestors to
the nearest directory present as a key here.