Engine

Internal documentation for the amalgam.engine module.

class amalgam.engine.Engine[source]

Class that serves as the frontend for parsing and running programs.

parser

A parser.Parser instance.

Type

parser.Parser

environment

An environment.Environment instance containing the built-in functions and a reference to the engine.Engine instance wrapped within a amalgams.Internal, accessible through the ~engine~ key.

Type

environment.Environment

parse_and_run(text: str)amalgam.amalgams.Amalgam[source]

Parses and runs the given text string.

repl(*, prompt: str = '> ', prompt_cont: str = '| ') → None[source]

Runs a REPL session that supports multi-line input.

Parameters
  • prompt (str) – The style of the prompt on regular lines.

  • prompt_cont (str) – The style of the prompt on continued lines.