Engine¶
Internal documentation for the amalgam.engine
module.
- class amalgam.engine.Engine[source]¶
Class that serves as the frontend for parsing and running programs.
- environment¶
An
environment.Environment
instance containing the built-in functions and a reference to theengine.Engine
instance wrapped within aamalgams.Internal
, accessible through the ~engine~ key.
- _interpret(text: str, source: str = '<unknown>') → amalgam.amalgams.Amalgam[source]¶
Parses and runs a
text
from asource
.Internal-facing method intended for use within
amalgam.primordials
.
- interpret(text: str, source: str = '<unknown>', file: IO = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>) → None[source]¶
Parses and runs a
text
from asource
.User-facing method intended for use within
amalgam.cli
. Prints the result tosys.stdout
unless specified. Handles pretty-printing ofamalgams.Notifications
.