Skip to main content

Crate doge_interp

Crate doge_interp 

Source
Expand description

A tree-walking interpreter for Doge — the second execution engine beside the Rust-transpiling compiler. It evaluates a checked AST directly against doge-runtime, so doge repl (and the interpreter path in general) skips the rustc build entirely. Every value operation calls the same doge-runtime function the generated Rust would, so an interpreted program behaves identically to a compiled one — a guarantee the examples parity suite enforces.

Structs§

ClassInfo
One class already defined in a REPL session: its name, the parent it inherits from (if any), and its method names.
Interp
An interpreter session. Holds the program-wide callable and class tables, one scope per file, and the mutable run state (recursion depth, current location). A doge repl session reuses one Interp across snippets, so bindings persist.
SessionScope
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.

Enums§

ReplParse
The outcome of parsing an interactive REPL snippet.

Functions§

run_program
Run a whole loaded program to completion: initialize every module, then execute the entry file’s top-level statements. Used to run a .doge file through the interpreter (the parity path beside doge build).