From 288727f09a1b3458c268497d111349e608c3f9fa Mon Sep 17 00:00:00 2001 From: "bozo.kopic" Date: Tue, 2 Aug 2022 01:20:12 +0200 Subject: init --- docs/repl.rst | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 docs/repl.rst (limited to 'docs/repl.rst') diff --git a/docs/repl.rst b/docs/repl.rst new file mode 100644 index 0000000..9046781 --- /dev/null +++ b/docs/repl.rst @@ -0,0 +1,40 @@ +REPL +==== + +REPL, as it's name suggest, is function implementing endless loop with +following actions: + + * read + + First step is reading data from input stream. + + * evaluate + + Data that was read from input stream represent expression that + should be evaluated by interpreter. + + * print + + Once evaluation finishes, result of evaluation is written to + output stream. In case resulting data is ``()``, print step is + skipped. + +This loop is stopped only in case closing of input or output stream is +detected. + + +Source code +----------- + +repl.h +'''''' + +.. literalinclude:: ../src_c/repl.h + :language: c + + +repl.c +'''''' + +.. literalinclude:: ../src_c/repl.c + :language: c -- cgit v1.2.3-70-g09d2