Removed formatter for file input
This commit is contained in:
parent
4f78e7cb3d
commit
fec9cffcd6
|
@ -41,4 +41,4 @@
|
|||
-- (Interface)
|
||||
|
||||
((Input a move, like "X 0 1":\n) put-str)
|
||||
((- - -) (- - -) (- - -)) ready
|
||||
((- - -) (- - -) (- - -)) ready
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue