From fd3df811217879ff65baa3e64207e52d54562241 Mon Sep 17 00:00:00 2001 From: halogenandtoast Date: Thu, 18 Dec 2014 13:07:05 -0500 Subject: [PATCH] Set yyin to file if provided. --- src/parse.y | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/parse.y b/src/parse.y index cc65189..7da3304 100644 --- a/src/parse.y +++ b/src/parse.y @@ -205,6 +205,10 @@ main(int argc, const char**argv) { int n; + if (argc > 1) { + yyin = fopen(argv[1], "r"); + } + // yydebug = 1; n = yyparse(NULL); if (n == 0) {