Register values now displayed in the recipe
This commit is contained in:
1 parent
b86dceb3c6
commit
e2ac297102
5 files changed
+58
No files matched your search
@@ -176,3 +176,20 @@ self.setOption = function(option, value) {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Send register values back to the app.
|
||||
*
|
||||
* @param {number} opIndex
|
||||
* @param {string[]} registers
|
||||
*/
|
||||
self.setRegisters = function(opIndex, registers) {
|
||||
self.postMessage({
|
||||
action: "setRegisters",
|
||||
data: {
|
||||
opIndex: opIndex,
|
||||
registers: registers
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -113,6 +113,12 @@ const FlowControl = {
|
||||
input = state.dish.get(Dish.STRING),
|
||||
registers = input.match(extractor);
|
||||
|
||||
if (!registers) return state;
|
||||
|
||||
if (ENVIRONMENT_IS_WORKER()) {
|
||||
self.setRegisters(state.progress, registers.slice(1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces references to registers (e.g. $R0) with the contents of those registers.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user