Documentation
¶
Overview ¶
Package repl implements the Read-Eval-Print Loop for the Monke programming language.
The REPL provides an interactive interface for users to enter Monke code, have it evaluated, and see the results immediately. It uses the Charm libraries (Bubbletea, Bubbles, and Lipgloss) to create a modern, user-friendly terminal interface with features like syntax highlighting and command history.
Key features:
- Interactive command input and execution
- Command history tracking
- Styled output with different colors for results and errors
- Persistent environment across commands
The main entry point is the Start function, which initializes and runs the REPL with the given username.
Index ¶
Constants ¶
View Source
const ( // Prompt is the default prompt for the REPL Prompt = ">> " // ContPrompt is the continuation prompt used in multiline input mode within the REPL. ContPrompt = ".. " )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorType ¶
type ErrorType int
ErrorType represents the type of error that occurred
const ( // NoError indicates that no error occurred, typically used as a default or initial value for error handling. NoError ErrorType = iota // ParseError indicates an error that occurred during the parsing phase of code evaluation or execution. ParseError // RuntimeError signifies an error that occurs during the execution of a program, typically at runtime. RuntimeError )
Click to show internal directories.
Click to hide internal directories.