Skip to content

Commit e88c137

Browse files
committed
I'm crushing your head!
1 parent 7655ad8 commit e88c137

2 files changed

Lines changed: 25 additions & 34 deletions

File tree

apps/Terminal.js

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*5/3/25: Proper field splitting
1+
/*5/3/25: Proper field splitting / Keeping track of mainParser«
22
33
bash splits the words in $SENT into separate lines:
44
@@ -9,10 +9,17 @@ $ for WORD in $SENT; do echo "$((i)): $WORD"; i=$((i+1)); done
99
2: the
1010
3: thing
1111
12-
The magic fix @YRTHSJLS!?!?
12+
The magic fix for field splitting @YRTHSJLS!?!?
1313
14-
*/
15-
/*5/2/25«
14+
* * *
15+
16+
@XMSKSLEO: Needed to add this line in order to keep the mainParser member of the shell
17+
object (along with its finalComStr) "alive and well". Otherwise it gets overwritten
18+
@WHKSFLGG (and the save_str variable is undefined/incorrect @GADLFJGMG, so updateHistory
19+
has nothing to do).
20+
21+
»*/
22+
/*5/2/25: Splitting subLines in spaces / Adding toString to ComSub, BQuote, etc«
1623
@YSHFKSOK: This is necessary in order to ensure that the output from the following echo
1724
command is split into 3 arguments (rather than 1 argument with spaces in it):
1825
@@ -4619,6 +4626,7 @@ return await this.scanWord(null, this.env);
46194626
const Parser = class {
46204627

46214628
constructor(code, opts={}) {//«
4629+
//WHKSFLGG
46224630
this.mainParser = opts.mainParser || this;
46234631
this.id = parserId++;
46244632
this.env = opts.env;
@@ -5816,22 +5824,13 @@ this.fatal("aborted");
58165824
else this.fatal(`unsupported operator: '${rop}'`);
58175825
}//»
58185826
if (this.isInteractive) {
5819-
/*
5820-
The partial part can be in both the scanner source *AND* the heredocs_str.
5821-
cwarn("SRC");
5822-
log(this.scanner.source.join(""));
5823-
cwarn("HDS");
5824-
log(heredocs_str);
5825-
*/
5827+
//The partial part can be in both the scanner source *AND* the heredocs_str.
58265828
if (!this.mainParser.finalComStr) {
58275829
//AGRHSORJF
58285830
this.mainParser.finalComStr = this.scanner.source.join("");
58295831
}
58305832
else this.mainParser.finalComStr += "\n"+this.scanner.source.join("");
58315833
if (heredocs_str !== null){
5832-
//cwarn("WUT");
5833-
//log(this.mainParser.finalComStr);
5834-
//log(heredocs_str);
58355834
this.mainParser.finalComStr += heredocs_str;
58365835
}
58375836
}
@@ -5880,10 +5879,15 @@ async expandComsub(tok, opts){//«
58805879
//cwarn("COMSUB", s);
58815880
let sub_lines = [];
58825881
try{
5882+
//log(this.parser);
5883+
let rv = await this.execute(s, {
58835884
//XMSKSLEO
5884-
let rv = await this.execute(s, {subLines: sub_lines, env: sdup(this.env), shell: this, term: this.term});
5885-
//log(sub_lines);
5886-
//log(sub_lines.join("\n"));
5885+
mainParser: this.parser.mainParser,
5886+
subLines: sub_lines,
5887+
env: sdup(this.env),
5888+
shell: this,
5889+
term: this.term
5890+
});
58875891
return sub_lines.join("\n");
58885892
}
58895893
catch(e){
@@ -6959,7 +6963,7 @@ term.response(mess,{isErr: true});
69596963
}
69606964
// term.response_end();
69616965

6962-
}/*»*/
6966+
}/
69636967
async execute(command_str, opts){//«
69646968
// const{term}=this;
69656969
let statements = await this.compile(command_str, opts);
@@ -7379,10 +7383,11 @@ async execute(str, opts={}){//«
73797383
}
73807384
let save_str;
73817385
//cwarn("EXE",this.curShell.parser.mainParser.id, this.curShell.parser.mainParser.finalComStr);
7386+
//GADLFJGMG
73827387
if (this.curShell.parser.mainParser.finalComStr) save_str = this.curShell.parser.mainParser.finalComStr.replace(/\n/g, "\t");
7388+
//log(this.curShell.parser);
73837389
this.responseEnd();
73847390
if (opts.noSave) return;
7385-
//log(`<${save_str}>`);
73867391
await this.updateHistory(save_str);
73877392
}//»
73887393
executeBackgroundCommand(s){//«
@@ -9678,20 +9683,6 @@ handleInsert(val){//«
96789683
this.scrollIntoView();
96799684
this.render();
96809685
}//»
9681-
/*
9682-
handleInsert(val){//«
9683-
let arr = val.split("");
9684-
let num_skipped = 0;
9685-
for (let ch of arr) {
9686-
if (!INT_ALNUM_PRINT_RE.test(ch)){
9687-
num_skipped++;
9688-
ch = " ";
9689-
}
9690-
this.handleKey(null, ch.charCodeAt(), null, true);
9691-
}
9692-
if (num_skipped) this.doOverlay(`Skipped: ${num_skipped} chars`);
9693-
}//»
9694-
*/
96959686
handleLineStr(str, if_no_render){//«
96969687
//handleLineStr(str, from_scroll, uselen, if_no_render){
96979688
let did_fail = false;

list.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
["README.md/2110","apps",["Audio.js/4093","BinView.js/9814","Folder.js/10944","Help.js/979","MediaPlayer.js/2074","Meta.js/2279","Music.js/4844","NN.js/1136","Poker.js/41043","Something.js/32","Terminal.js/258241","TextEdit.js/5174","WorkMan.js/3808","YourApp.js/418","dev",["Ermpt.js/507","Grammar.js/15536","HTML.js/1348","Hands.js/15575","Kuhn.js/7362","Launcher.js/20502","NewShell.js/84972","Player.js/2121","Poker5.js/4891","TakePicture.js/3475","Worker.js/1195","audio",["Blah.js/3601","MakeSomeBass.js/5879","Midi.js/3953","Noise.js/2048","Vowels.js/13141","cool",["RandomWalk.js/5090"],"zsave",["Faust.js/35023","Jazzed.js/18165","Jazzed2.js/31797","Karplus.js/30845","Noisecraft.js/11936"]],"svg",["SVG1.js/12599","SVG2.js/18599"],"zold",["Poker.js/26967","Poker2.js/76136","Poker3.js/65113","Poker4.js/36503"]],"games",["Arcade.js/12599"],"hw",["MidiCtl.js/3691"],"media",["2Cameras.js/3258","Camera.js/3673","MediaPlayer.js/16115","VideoCutter.js/44729"],"template",["Basic.js/489","Template.js/396","WebAudio.js/2877"],"util",["ImageView.js/2696","Unicoder.js/16896"]],"bin",["ALLLIST/106","APPLIST/104","DIRGET/47","DOBEAUTIFY/71","DOLINKS/330","DOZIP/801","GITUP/396","MKLOTWLIST/136","MKSYMLINKS/487","PYSERV/84","SSLPYSERV.py/528","dojsbeautify/71","js",["getdir.js/665"],"vallgrep/398","vvallgrep/544"],"coms",["audio.js/1766","esprima.js/171824","extra.js/10807","fs.js/26757","mail.js/43901","shell.js/175037","template.js/336","test",["dummy.js/21"],"test.js/1982","yt.js/66863","zhold",["mail.js/22724"]],"doc",["EDITING/1847","START_HERE/2609","apis",["imap-flow.js/104043","imapflow.txt/38670"],"concepts",["DATA_IPC/4482"],"dev",["CHANGES/2853","DESK/63027","FS/7462","TERMINAL/149463","VIM/16037"]],"index.html/1184","local",["_poker",["001/19229","003/23581","FLOP_EV_1.json/3312805","FLOP_EV_2.json/3389041","FLOP_EV_3.json/3719620","FLOP_EV_4.json/3503737","FLOP_EV_5.js/3470856","RIVER_EV_1.json/38068483","RIVER_EV_2.json/39745965","RIVER_EV_3.json/44070681","RIVER_EV_4.json/41514544","RIVER_EV_5.json/41100610","TURN_EV_1.json/17598825","TURN_EV_2.json/18032587","TURN_EV_3.json/19787973","TURN_EV_4.json/18622556","TURN_EV_5.json/18423232"]],"mods",["audio",["multi_freq_worklet.js/1502","random_walk_worklet.js/3039"],"games",["GBEmulator.js/9708","NESEmulator.js/222309","binjgb.wasm/87232"],"help",["shell.js/3591"],"hw",["midi.js/2323"],"term",["email.js/10406","less.js/19568","log.js/13262","vim.js/150516"],"util",["math.js/12125","nn",["snake",["worker.js/29373"]],"pretty.js/93856","walt.js/204893","wasm.js/42764","wasmparser.js/34331","webmparser.js/58730"],"workers",["poker.js/37420"]],"node",["server.js/7198","svcs",["imap.js/17772","mount.js/16553","smtp.js/1359","template.js/1831","ws.js/2156","ytdl.js/11982"]],"sys",["config.js/8812","desk.js/216683","fs.js/66130","util.js/20006"],"www",["blog.css/181","config",["bashrc.txt/692","desert.vim/2952","nano-hack.txt/2324","vimrc.txt/1443"],"desk.css/1898","docs",["blog-template.html/291","help.html/9104","what-it-is.html/4370"],"examples",["test.sh/66"],"favicon.ico/15086","lotw256.png/41075","lotw48.png/2966","stuff",["noise.html/1669"]],"zzhold",["DESK/1306","SHELL/17941","init",["my_setup.js/1264"],"noisecraft",["audiograph.js/22588","audioview.js/5086","audioworklet.js/1319","compiler.js/15169","dialog.js/3578","editor.js/72623","eventable.js/965","knob.js/10041","midi.js/2044","model.js/57480","music.js/7887","synth.js/6652","utils.js/6876","zhold",["audioworklet.js/2980","compiler.js/37421","model.js/57645"]],"writes",["RUNTIME.js/4583","Terminal.js/80662"]]]
1+
["README.md/2110","apps",["Audio.js/4093","BinView.js/9814","Folder.js/10944","Help.js/979","MediaPlayer.js/2074","Meta.js/2279","Music.js/4844","NN.js/1136","Poker.js/41043","Something.js/32","Terminal.js/258249","TextEdit.js/5174","WorkMan.js/3808","YourApp.js/418","dev",["Ermpt.js/507","Grammar.js/15536","HTML.js/1348","Hands.js/15575","Kuhn.js/7362","Launcher.js/20502","NewShell.js/84972","Player.js/2121","Poker5.js/4891","TakePicture.js/3475","Worker.js/1195","audio",["Blah.js/3601","MakeSomeBass.js/5879","Midi.js/3953","Noise.js/2048","Vowels.js/13141","cool",["RandomWalk.js/5090"],"zsave",["Faust.js/35023","Jazzed.js/18165","Jazzed2.js/31797","Karplus.js/30845","Noisecraft.js/11936"]],"svg",["SVG1.js/12599","SVG2.js/18599"],"zold",["Poker.js/26967","Poker2.js/76136","Poker3.js/65113","Poker4.js/36503"]],"games",["Arcade.js/12599"],"hw",["MidiCtl.js/3691"],"media",["2Cameras.js/3258","Camera.js/3673","MediaPlayer.js/16115","VideoCutter.js/44729"],"template",["Basic.js/489","Template.js/396","WebAudio.js/2877"],"util",["ImageView.js/2696","Unicoder.js/16896"]],"bin",["ALLLIST/106","APPLIST/104","DIRGET/47","DOBEAUTIFY/71","DOLINKS/330","DOZIP/801","GITUP/396","MKLOTWLIST/136","MKSYMLINKS/487","PYSERV/84","SSLPYSERV.py/528","dojsbeautify/71","js",["getdir.js/665"],"vallgrep/398","vvallgrep/544"],"coms",["audio.js/1766","esprima.js/171824","extra.js/10807","fs.js/26757","mail.js/43901","shell.js/175037","template.js/336","test",["dummy.js/21"],"test.js/1982","yt.js/66863","zhold",["mail.js/22724"]],"doc",["EDITING/1847","START_HERE/2609","apis",["imap-flow.js/104043","imapflow.txt/38670"],"concepts",["DATA_IPC/4482"],"dev",["CHANGES/2853","DESK/63027","FS/7462","TERMINAL/149463","VIM/16037"]],"index.html/1184","local",["_poker",["001/19229","003/23581","FLOP_EV_1.json/3312805","FLOP_EV_2.json/3389041","FLOP_EV_3.json/3719620","FLOP_EV_4.json/3503737","FLOP_EV_5.js/3470856","RIVER_EV_1.json/38068483","RIVER_EV_2.json/39745965","RIVER_EV_3.json/44070681","RIVER_EV_4.json/41514544","RIVER_EV_5.json/41100610","TURN_EV_1.json/17598825","TURN_EV_2.json/18032587","TURN_EV_3.json/19787973","TURN_EV_4.json/18622556","TURN_EV_5.json/18423232"]],"mods",["audio",["multi_freq_worklet.js/1502","random_walk_worklet.js/3039"],"games",["GBEmulator.js/9708","NESEmulator.js/222309","binjgb.wasm/87232"],"help",["shell.js/3591"],"hw",["midi.js/2323"],"term",["email.js/10406","less.js/19568","log.js/13262","vim.js/150516"],"util",["math.js/12125","nn",["snake",["worker.js/29373"]],"pretty.js/93856","walt.js/204893","wasm.js/42764","wasmparser.js/34331","webmparser.js/58730"],"workers",["poker.js/37420"]],"node",["server.js/7198","svcs",["imap.js/17772","mount.js/16553","smtp.js/1359","template.js/1831","ws.js/2156","ytdl.js/11982"]],"sys",["config.js/8812","desk.js/216683","fs.js/66130","util.js/20006"],"www",["blog.css/181","config",["bashrc.txt/692","desert.vim/2952","nano-hack.txt/2324","vimrc.txt/1443"],"desk.css/1898","docs",["blog-template.html/291","help.html/9104","what-it-is.html/4370"],"examples",["test.sh/66"],"favicon.ico/15086","lotw256.png/41075","lotw48.png/2966","stuff",["noise.html/1669"]],"zzhold",["DESK/1306","SHELL/17941","init",["my_setup.js/1264"],"noisecraft",["audiograph.js/22588","audioview.js/5086","audioworklet.js/1319","compiler.js/15169","dialog.js/3578","editor.js/72623","eventable.js/965","knob.js/10041","midi.js/2044","model.js/57480","music.js/7887","synth.js/6652","utils.js/6876","zhold",["audioworklet.js/2980","compiler.js/37421","model.js/57645"]],"writes",["RUNTIME.js/4583","Terminal.js/80662"]]]

0 commit comments

Comments
 (0)