summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-01-22 06:12:24 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-01-22 06:12:24 -0800
commita928f32d7f83e7cb0cbf7a7251d3edd5ca5487ce (patch)
tree1aabfe9013641554fee6f11f43412780c06550a0 /share
parent1468f3fc7fba26345de8a67b66d4af5367c13037 (diff)
downloadtxr-a928f32d7f83e7cb0cbf7a7251d3edd5ca5487ce.tar.gz
txr-a928f32d7f83e7cb0cbf7a7251d3edd5ca5487ce.tar.bz2
txr-a928f32d7f83e7cb0cbf7a7251d3edd5ca5487ce.zip
Enable unbound warnings when expanding TXR code.
With this change, Lisp expansion-time warnings are no longer suppressed during the parsing of the TXR pattern language. Embedded Lisp expressions can refer to TXR pattern variables, which generates spurious warnings that must be suppressed. Since TXR pattern variables are dynamically introduced in a very flexible way, it's hard to do an exact job of this. We take the crude approach that warnings are suppressed for all pattern variables that appear anywhere in the TXR code. To do that, we identify, at parse time, all directives which can bind new variables, and register those variables as if they were tentative global defs, purging all pending warnings for them. * match.c (binding_directive_table): New static hash table. (match_reg_var, match_reg_params, match_reg_elem): New functions. (match_reg_var_rec): New static function. (dir_tables_init): gc-protect binding_directive_table, and populate its entries. * match.h (into_k, named_k): Declared. (match_reg_var, match_reg_params, match_reg_elem): Declared. * parser.y (process_catch_exprs): New static function. (elem): Call match_reg_elem for each basic directive, to process the variables in that directive according to its operator symbol. Do this for each compound form elem and variable elem. Te horizontal @(define) eleme has its own grammar production here, and we handle its parameter list in that rule. (define_clause): Handle the parameters of a vertical @(define). It binds pattern variables, and so we must suppress unbound warnings for those. (catch_clauses_opt): Process the parameters bound by @(catch) clauses. (output_clause): Suppress warnings for the variables nominated by any :into or :named argument. (expand_repeat_rep_args): Suppress warnings for :counter variable, and for :vars variables. (parse_once): Remove the warning-muffling handler frame set up around the yyparse call. * txr.c (txr_main): Suppress warnings for TXR variables defined using -D syntax on the command line. Dump deferred warnings after parsing a .txr file.
Diffstat (limited to 'share')
0 files changed, 0 insertions, 0 deletions