|
| 1 | +signature ReplCommands = |
| 2 | +sig |
| 3 | + |
| 4 | +(* Facilities for turning chunks of script file text into commands that can |
| 5 | + be fed to running REPL instances. |
| 6 | +
|
| 7 | + Editor is responsible for detecting/selecting the relevant text but does |
| 8 | + not need to examine it further. Instead, it can feed, for example |
| 9 | +
|
| 10 | + ReplCommands.execute_command (sml_text (...,{filename=...,text =...})); |
| 11 | +
|
| 12 | + to the running session. The ...s above correspond solely to trivially |
| 13 | + derived information about where and what the text is. The editor needs to |
| 14 | + know to use temporary files to stash particularly huge bits of text, using |
| 15 | + the ViaFile constructor to the string_src type rather than writing huge |
| 16 | + string literals into the REPL. |
| 17 | +
|
| 18 | + If the parsing of text into commands fails, the functions will put their |
| 19 | + errors into the Failure constructor and the execute_command can then get the |
| 20 | + REPL to emit the appropriate diagnostics. |
| 21 | +
|
| 22 | +*) |
| 23 | + |
| 24 | +datatype string_src = Direct of string | ViaFile of {proxy_filename : string} |
| 25 | +type script_text = locn.locn * {filename : string option, text : string_src} |
| 26 | + |
| 27 | +datatype repl_command = Success of string | Failure of string |
| 28 | + |
| 29 | +val sml_text : script_text -> repl_command |
| 30 | +val set_initial_goal : script_text -> repl_command |
| 31 | +val set_by_subgoal : script_text -> repl_command |
| 32 | +val set_suffices_by_subgoal : script_text -> repl_command |
| 33 | +val apply_tactic : script_text -> repl_command |
| 34 | +val apply_tactic_pattern : script_text -> repl_command |
| 35 | + (* tactic patterns as per the second argument to the >~ operator *) |
| 36 | +val load_dependencies : script_text -> repl_command |
| 37 | + |
| 38 | +val execute_command : repl_command -> unit |
| 39 | + |
| 40 | +end |
0 commit comments