Skip to content

Commit

Permalink
chore: clean up stdout garbage whitespace output
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyV99 authored and connorjclark committed Aug 6, 2023
1 parent 888a050 commit 5ce129b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/parser/ffscript.ypp
Expand Up @@ -28,7 +28,7 @@ extern int32_t yycol;
extern char* yytext;
extern int32_t yyleng;
extern int32_t yylex(void);
extern FILE *yyin;
extern FILE *yyin, *yyout;
extern void resetLexer();
void yyerror(std::unique_ptr<ASTFile>& root, const char* s);
void yymsg(string const& message, int32_t row = yyrow, int32_t col = yycol, char const* txt = yytext);
Expand Down Expand Up @@ -2269,6 +2269,7 @@ namespace ZScript

// Read in the file.
yyin = fopen(filename.c_str(), "r");
yyout = std::tmpfile();
if (!yyin)
{
zconsole_error("Can't open input file");
Expand All @@ -2281,6 +2282,7 @@ namespace ZScript
{
result.reset();
}
fclose(yyout);
fclose(yyin);

return std::unique_ptr<ASTFile>(result.release());
Expand Down

0 comments on commit 5ce129b

Please sign in to comment.