Add support for self-modifying programs to core
This commit is contained in:
@ -14,6 +14,14 @@ export type DocumentRange = {
|
||||
charRange?: CharRange;
|
||||
};
|
||||
|
||||
/** Type denoting a document edit */
|
||||
export type DocumentEdit = {
|
||||
/** Range to replace with the given text. Keep empty to insert text */
|
||||
range: DocumentRange;
|
||||
/** Text to replace the given range with */
|
||||
text: string;
|
||||
};
|
||||
|
||||
/** Source code token provider for the language, specific to Monaco */
|
||||
export type MonacoTokensProvider = monaco.languages.IMonarchLanguage;
|
||||
|
||||
@ -30,6 +38,9 @@ export type StepExecutionResult<RS> = {
|
||||
/** String to write to program output */
|
||||
output?: string;
|
||||
|
||||
/** Self-modifying programs: edit to apply on code */
|
||||
codeEdits?: DocumentEdit[];
|
||||
|
||||
/**
|
||||
* Used to highlight next line to be executed in the editor.
|
||||
* Passing `null` indicates reaching the end of program.
|
||||
|
Reference in New Issue
Block a user