|
spudplate
Template scaffolding compiler for spudlang .spud files
|
Abstract source of user input for ask statements.
More...
#include <interpreter.h>
Public Member Functions | |
| virtual std::string | prompt (const PromptRequest &req)=0 |
Display the prompt described by req and return the user's raw answer. | |
| virtual bool | authorize (const std::string &summary)=0 |
| Display a security summary and return whether to proceed. | |
Abstract source of user input for ask statements.
|
pure virtual |
Display the prompt described by req and return the user's raw answer.
The interpreter parses the returned string, validates it against type and options, and on rejection calls back with previous_error set. Implementations deliver one raw line per call.
Implemented in spudplate::StdinPrompter, and spudplate::ScriptedPrompter.
|
pure virtual |
Display a security summary and return whether to proceed.
Called once, before any statement runs, when the program contains run clauses. The summary is multi-line and lists every literal command that may execute. Returning false aborts the run cleanly with no side effects.
Implemented in spudplate::StdinPrompter, and spudplate::ScriptedPrompter.