Removed formatter for file input

This commit is contained in:
Devine Lu Linvega 2024-05-09 21:01:55 -07:00
parent 4f78e7cb3d
commit fec9cffcd6
2 changed files with 3 additions and 8 deletions

View File

@ -41,4 +41,4 @@
-- (Interface)
((Input a move, like "X 0 1":\n) put-str)
((- - -) (- - -) (- - -)) ready
((- - -) (- - -) (- - -)) ready

View File

@ -104,18 +104,13 @@ file_import(char *path)
{
FILE *f;
int pr = 0;
char c, last = 0;
char c;
if((f = fopen(path, "r"))) {
while(fread(&c, 1, 1, f)) {
c = c <= 0x20 ? 0x20 : c;
if(c == ' ' && last == '(') continue;
if(c == ')' && last == ' ') dst_--;
if(c == ' ' && last == ' ') dst_--;
if(c == '(') pr++;
if(c == ')') pr--;
if(c == '(' && last != '?' && !spacer(last)) *dst_++ = ' ';
if(last == ')' && !spacer(c)) *dst_++ = ' ';
*dst_++ = last = c;
*dst_++ = c;
}
fclose(f);
if(pr) fprintf(stderr, "Modal program imbalanced.\n");