summaryrefslogtreecommitdiffstats
path: root/parser.l
diff options
context:
space:
mode:
Diffstat (limited to 'parser.l')
-rw-r--r--parser.l14
1 files changed, 14 insertions, 0 deletions
diff --git a/parser.l b/parser.l
index d2745c99..4925b113 100644
--- a/parser.l
+++ b/parser.l
@@ -66,6 +66,7 @@ cnum lineno = 1;
int opt_loglevel = 1; /* 0 - quiet; 1 - normal; 2 - verbose */
int errors;
+val spec_file_str;
val form_to_ln_hash;
@@ -693,3 +694,16 @@ void parse_init(void)
form_to_ln_hash = make_hash(t, nil, nil);
}
+
+void parse_reset(val spec_file)
+{
+ errors = 0;
+ lineno = 1;
+ spec_file_str = spec_file;
+ {
+ FILE *in = w_fopen(c_str(spec_file_str), L"r");
+ if (in == 0)
+ uw_throwf(file_error_s, lit("unable to open ~a"), spec_file_str, nao);
+ yyin_stream = make_stdio_stream(in, spec_file_str, t, nil);
+ }
+}