Don't print newlines on (prn) or last expr in file

This commit is contained in:
Sage Vaillancourt 2020-11-02 15:23:04 -05:00
parent 058bd302df
commit 78f5b98f9f
2 changed files with 4 additions and 3 deletions

View File

@ -90,6 +90,7 @@ struct Other {
char* stringObj(char *dest, const Object *obj); char* stringObj(char *dest, const Object *obj);
void printList(const Object *list); void printList(const Object *list);
void printObj(const Object *obj); void printObj(const Object *obj);
void _printObj(const Object *obj, int newline);
void debugObj(const Object *obj); void debugObj(const Object *obj);
void printErr(const Object *obj); void printErr(const Object *obj);

View File

@ -396,8 +396,7 @@ Object print(Object p, Object ignore, struct Environment *env)
{ {
p = cloneObject(p); p = cloneObject(p);
p = eval(&p, env); p = eval(&p, env);
printObj(&p); _printObj(&p, 0);
printf("\n");
return p; return p;
} }
@ -624,7 +623,8 @@ int readFile(const char *filename, struct Environment *env) {
} }
r = parseEval(page, env); r = parseEval(page, env);
printAndClean(&r); cleanObject(&r);
printf("\n");
fclose(input); fclose(input);
return 0; return 0;