soto: amend tab sole-effect json and handler

The behaviour of $tab sole-effects lacked a 'tab' key, so Soto wasn't
catching or writing them to the screen. This commit amends both the
handler and the sole-effect to fix that behaviour.
This commit is contained in:
Matilde Park 2019-11-25 19:38:07 -05:00
parent fad9fcb16b
commit be4b479660
5 changed files with 20 additions and 21 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -53,6 +53,7 @@
:- %a
%+ turn p.sef
|= [=cord =^tank]
%+ frond %tab
%- pairs
:~ match+s+cord
info+(tape ~(ram re tank))

View File

@ -68,6 +68,7 @@
:- %a
%+ turn p.sef
|= [=cord =^tank]
%+ frond %tab
%- pairs
:~ match+s+cord
info+(tape ~(ram re tank))

View File

@ -26,33 +26,30 @@ export class Store {
if (dojoReply.map) {
return dojoReply.map(reply => this.handleEvent(reply));
}
switch(Object.keys(dojoReply)[0]) {
case 'txt':
return this.print(dojoReply.txt);
return this.print(dojoReply.txt);
case 'tab':
for (let suggestion of dojoReply.tab) {
let match = suggestion.match;
let info = suggestion.info;
this.print(match + " " + info);
}
return;
this.print(dojoReply.tab.match + " " + dojoReply.tab.info);
return;
case 'tan':
return dojoReply.tan.split("\n").map(this.print);
return dojoReply.tan.split("\n").map(this.print);
case 'pro':
return this.setState({ prompt: dojoReply.pro.cad });
return this.setState({ prompt: dojoReply.pro.cad });
case 'hop':
return this.setState({ cursor: dojoReply.hop });
return this.setState({ cursor: dojoReply.hop });
case 'det':
buffer.receive(dojoReply.det);
return this.sync(dojoReply.det.ted);
buffer.receive(dojoReply.det);
return this.sync(dojoReply.det.ted);
case 'act':
switch(dojoReply.act) {
case 'clr': return this.setState({txt: []});
case 'nex': return this.setState({
input: "",
cursor: 0
});
} break;
switch(dojoReply.act) {
case 'clr': return this.setState({txt: []});
case 'nex': return this.setState({
input: "",
cursor: 0
});
} break;
default: console.log(dojoReply);
}
}