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.Environmentinstance containing the built-in functions and a reference to theengine.Engineinstance wrapped within aamalgams.Internal, accessible through the ~engine~ key.
- _interpret(text: str, source: str = '<unknown>') → amalgam.amalgams.Amalgam[source]¶
Parses and runs a
textfrom 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
textfrom asource.User-facing method intended for use within
amalgam.cli. Prints the result tosys.stdoutunless specified. Handles pretty-printing ofamalgams.Notifications.