diff options
author | Akim Demaille <akim.demaille@gmail.com> | 2019-10-22 09:03:00 +0200 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2019-10-26 10:39:01 +0200 |
commit | 8228d96d338156c14bc71a45f9dd3bfa8f82b5c1 (patch) | |
tree | 7dff3c310620602668599277258157ce1475181e /src/getargs.c | |
parent | a5fc4e3b44870abddc9fdaaf53e98a1ca0ce7b16 (diff) | |
download | bison-8228d96d338156c14bc71a45f9dd3bfa8f82b5c1.tar.gz |
reader: reduce the "scope" of global variables
We have too many global variables, adding structure would help. For a
start, let's hide some of the variables closer to their usage.
* src/getargs.c, src/files.h (current_file): Move to...
* src/scan-gram.c: here.
* src/scan-gram.h (gram_in, gram__flex_debug): Remove, make them
private to the scanner.
* src/reader.h, src/reader.c (reader): Take a grammar file as argument.
Move the handling of scanner variables to...
* src/scan-gram.l (gram_scanner_open, gram_scanner_close): here.
(gram_scanner_initialize): Remove, replaced by gram_scanner_open.
* src/main.c: Adjust.
Diffstat (limited to 'src/getargs.c')
-rw-r--r-- | src/getargs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/getargs.c b/src/getargs.c index 815df331..bf4a938f 100644 --- a/src/getargs.c +++ b/src/getargs.c @@ -853,7 +853,7 @@ getargs (int argc, char *argv[]) usage (EXIT_FAILURE); } - current_file = grammar_file = uniqstr_new (argv[optind]); + grammar_file = uniqstr_new (argv[optind]); MUSCLE_INSERT_C_STRING ("file_name", grammar_file); } |