diff options
| author | Shinya Sato <shinnya.sato@gmail.com> | 2021-10-17 18:15:58 +0900 |
|---|---|---|
| committer | Shinya Sato <shinnya.sato@gmail.com> | 2021-10-17 18:15:58 +0900 |
| commit | 1777b78f88ddf2089e51ad110e4390a30d25b0fe (patch) | |
| tree | 56e99323399868eb57b7dbc19778c8c0add3bfc8 /src | |
| parent | 08a924370690ead6ba5d7d8a1392fbe616ad83f3 (diff) | |
| download | inpla-1777b78f88ddf2089e51ad110e4390a30d25b0fe.tar.gz inpla-1777b78f88ddf2089e51ad110e4390a30d25b0fe.zip | |
v0.4.2
Diffstat (limited to '')
| -rw-r--r-- | src/inpla.l | 2 | ||||
| -rw-r--r-- | src/inpla.y | 10 | ||||
| -rw-r--r-- | src/linenoise/.gitignore | 3 | ||||
| -rw-r--r-- | src/linenoise/linenoise-multiline.patch | 12 |
4 files changed, 20 insertions, 7 deletions
diff --git a/src/inpla.l b/src/inpla.l index 5547d32..f5b386d 100644 --- a/src/inpla.l +++ b/src/inpla.l @@ -33,7 +33,7 @@ static int mygetinput(char *buf, int size) { fprintf(stderr,"input line too long\n"); return YY_NULL; } sprintf(buf,"%s\n",line); linenoiseHistoryAdd(line); - //linenoiseHistorySave(".inpla.history.txt"); + linenoiseHistorySave(".inpla.history.txt"); free(line); return strlen(buf); } diff --git a/src/inpla.y b/src/inpla.y index 0089333..ff65f39 100644 --- a/src/inpla.y +++ b/src/inpla.y @@ -7,6 +7,8 @@ #include <errno.h> #include <sched.h> +#include "linenoise/linenoise.h" + #include "ast.h" #include "id_table.h" #include "name_table.h" @@ -46,8 +48,8 @@ int ActiveThreadNum=0; //#define YYDEBUG 1 -#define VERSION "0.4.1" -#define BUILT_DATE "22 Sept. 2021" +#define VERSION "0.4.2" +#define BUILT_DATE "16 Oct. 2021" extern FILE *yyin; @@ -1117,6 +1119,7 @@ void puts_term(VALUE ptr) { Puts_list_element++; if (Puts_list_element > PUTS_ELEMENTS_NUM) { printf("...]"); + Puts_list_element=0; break; } @@ -1331,7 +1334,7 @@ void freeAgentRec(VALUE ptr) { } else { if (BASIC(ptr)->id == ID_CONS) { if (IS_FIXNUM(AGENT(ptr)->port[0])) { - VALUE port1 = AGENT(ptr)->port[0]; + VALUE port1 = AGENT(ptr)->port[1]; freeAgent(ptr); ptr = port1; goto loop; } @@ -7574,6 +7577,7 @@ int main(int argc, char *argv[]) } + linenoiseHistoryLoad(".inpla.history.txt"); // the main loop of parsing and execution while(1) { diff --git a/src/linenoise/.gitignore b/src/linenoise/.gitignore deleted file mode 100644 index 7ab7825..0000000 --- a/src/linenoise/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -linenoise_example -*.dSYM -history.txt diff --git a/src/linenoise/linenoise-multiline.patch b/src/linenoise/linenoise-multiline.patch new file mode 100644 index 0000000..c7613c3 --- /dev/null +++ b/src/linenoise/linenoise-multiline.patch @@ -0,0 +1,12 @@ +258c258,260 +< if (tcsetattr(fd,TCSAFLUSH,&raw) < 0) goto fatal; +--- +> //if (tcsetattr(fd,TCSAFLUSH,&raw) < 0) goto fatal; +> // https://github.com/antirez/linenoise/issues/43 +> if (tcsetattr(fd,TCSADRAIN,&raw) < 0) goto fatal; +269c271,273 +< if (rawmode && tcsetattr(fd,TCSAFLUSH,&orig_termios) != -1) +--- +> // if (rawmode && tcsetattr(fd,TCSAFLUSH,&orig_termios) != -1) +> // https://github.com/antirez/linenoise/issues/43 +> if (rawmode && tcsetattr(fd,TCSADRAIN,&orig_termios) != -1) |
