|
microlisp 0.1.0
A small Scheme-subset interpreter in modern C.
|
microlisp CLI: REPL, single-expression eval, and script runner.
More...
#include "microlisp/microlisp.h"#include <signal.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>
Macros | |
| #define | IS_TTY(fd) isatty(fd) |
Functions | |
| static int | grow_buf (uint8_t **buf, size_t *cap) |
| static FILE * | open_input (const char *path) |
| static int | slurp (FILE *in, uint8_t **out_bytes, size_t *out_len) |
| static void | print_usage (FILE *out) |
| static void | print_version (FILE *out) |
| static int | exit_code_for (microlisp_status st) |
| static int | eval_source (microlisp_state *state, const char *source, size_t len, int print_result) |
| static int | run_repl (microlisp_state *state) |
| static int | run_script_file (microlisp_state *state, const char *path) |
| int | main (int argc, char **argv) |
microlisp CLI: REPL, single-expression eval, and script runner.
Usage: microlisp Interactive REPL on stdin. microlisp FILE Run FILE as a script (one or more top-level forms); print the last form's result. microlisp - Run stdin as a script (non-interactive). microlisp -e EXPR Evaluate EXPR and print its result. microlisp –help | -h microlisp –version | -V
Exit codes (stable for shell scripting): 0 success 1 evaluation error (read syntax, type error, unbound variable, etc.) 2 I/O error reading the input or writing to stdout, or an unknown option / unknown subcommand on the command line
| #define IS_TTY | ( | fd | ) | isatty(fd) |
|
static |
|
static |
|
static |
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |