File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -651,11 +651,15 @@ if {~ <=$&primitives writehistory} {
651651fn - % batch - loop = $ & batchloop
652652fn - % is - interactive = $ & isinteractive
653653
654+ # NOTE : $ & readline might not actually exist . we just assume it does for this
655+ # proof - of - concept .
656+ fn - % readline = $ & readline
657+
654658fn % parse {
655659 if % is - interactive {
656660 let ( in = ( ) ; p = $ * ( 1 ) )
657661 let ( code = <= { $ & parse {
658- let ( r = <= { $ & readline $p } ) {
662+ let ( r = <= { % readline $p } ) {
659663 in = $in $r
660664 p = $ * ( 2 )
661665 result $r
Original file line number Diff line number Diff line change @@ -219,12 +219,20 @@ static int cmdfill(Input *in) {
219219extern Tree * parse (List * fc ) {
220220 int result ;
221221 void * oldpspace ;
222+ Ref (List * , oldfillcmd , fillcmd );
222223
223224 /* TODO: change this error message */
224225 if (input -> parsing )
225226 fail ("$&parse" , "cannot perform nested parsing" );
226227
227228 assert (input -> error == NULL );
229+
230+ /* TODO: update this check --
231+ *
232+ * $ es -c '<={$&parse {result echo hello world}}'
233+ *
234+ * should work. also, ignoreeof
235+ */
228236 if (ISEOF (input ))
229237 throw (mklist (mkstr ("eof" ), NULL ));
230238
@@ -250,7 +258,8 @@ extern Tree *parse(List *fc) {
250258 EndExceptionHandler
251259
252260 input -> parsing = FALSE;
253- fillcmd = NULL ;
261+ fillcmd = oldfillcmd ;
262+ RefEnd (oldfillcmd );
254263
255264 if (result || input -> error != NULL ) {
256265 const char * e = input -> error ;
You can’t perform that action at this time.
0 commit comments