1 |
|
2001-10-12 Gary V. Vaughan <gary@gnu.org> |
2 |
|
|
3 |
|
Rather than forcing each builtin definition to manage its own |
4 |
|
argument range checking, tabulate the maxima and minima for all |
5 |
|
builtins in each module. This forces us to consider what the |
6 |
|
valid ranges for each builtin should be, and moves the checking |
7 |
|
code out of each builtin implementation and into the builtin |
8 |
|
caller infrastructure. |
9 |
|
|
10 |
|
* m4/m4module.h (struct m4_builtin): Add argument minima and |
11 |
|
maxima. |
12 |
|
* m4/m4private.h (struct m4_token): Reflect them here too. |
13 |
|
* m4/input.c (struct input_block): ...and here. |
14 |
|
(m4_token_copy): New function for token copying. |
15 |
|
(init_macro_token): Copy them from a token to the input stack. |
16 |
|
(m4_next_token): Don't forget to initialise them for text |
17 |
|
macros. |
18 |
|
* m4/macro.c (expand_argument): Use m4_token_copy, and also |
19 |
|
check argument counts before calling the builtin handler. |
20 |
|
* m4/symtab.c (m4_symbol_builtin): Take minima and maxima params. |
21 |
|
(m4_symbol_macro): Likewise. |
22 |
|
* m4/builtin.c (m4_builtin_pushdef): Add min_args and max_args |
23 |
|
parameters. Updated all callers. |
24 |
|
(m4_builtin_define): Ditto. |
25 |
|
(m4_macro_pushdef, m4_macro_define): Ditto. |
26 |
|
* m4/symtab.c (m4_symbol_builtin, m4_symbol_define): Ditto. |
27 |
|
* modules/evalparse.c: Declare argument counts for defined |
28 |
|
builtins and remove explicit calls to m4_bad_argc(). |
29 |
|
* modules/gnu.c: Ditto. |
30 |
|
* modules/load.c: Ditto. |
31 |
|
* modules/m4.c: Ditto. |
32 |
|
* modules/modtest.c: Ditto. |
33 |
|
* modules/mpeval.c: Ditto. |
34 |
|
* modules/perl.c: Ditto. |
35 |
|
* modules/shadow.c: Ditto. |
36 |
|
* modules/stdlib.c: Ditto. |
37 |
|
* modules/time.c: Ditto. |
38 |
|
* TODO: Updated. |
39 |
|
|
40 |
2001-10-10 Gary V. Vaughan <gary@gnu.org> |
2001-10-10 Gary V. Vaughan <gary@gnu.org> |
41 |
|
|
42 |
The trace semantics now attach the trace bit to a symbol name. |
The trace semantics now attach the trace bit to a symbol name. |