23 Commits

Author SHA1 Message Date
Eric Blake
6b1c5a2cbd Document join, in order to fix bug in m4wrap example.
* examples/join.m4: New file.
* examples/wraplifo2.m4: Likewise.
* Makefile.am (EXTRA_DIST): Add new files.
* doc/m4.texinfo (Improved m4wrap): New node.
(Defn, Location): Enhance tests.
(Shift): Document the composit macro join.
(Incompatibilities): Move documentation of LIFO vs. FIFO...
(M4wrap): ...here, to match improved example.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-03-15 20:52:36 -06:00
Eric Blake
06991b51ef Add regression test for multi-character quote recursion.
* examples/foreach2.m4: Use $0 rather than spelling out name.
* examples/foreachq2.m4: Likewise.
* examples/forloop2.m4: Likewise.
* examples/hanoi.m4: Likewise.
* examples/trace.m4: Likewise.
* doc/m4.texinfo (Improved forloop): Document advantage of $0.
(Improved foreach): Adjust dump from file.

Signed-off-by: Eric Blake <ebb9@byu.net>
2008-02-16 14:50:13 -07:00
Eric Blake
bcb92cf23a Stage 5: add notion of quote age.
* m4/m4module.h (m4_get_symbol_value_quote_age): New prototype.
(m4_set_symbol_value_text): Adjust prototype.
(m4_has_syntax): Factor out the unsigned char cast.
* m4/m4private.h (struct m4_syntax_table): Add syntax_age and
quote_age members.
(m4__quote_age, m4__safe_quotes): New accessor macros, no need for
functions at this point.
(struct m4_symbol_value, struct m4_macro_args): Add quote_age
member.
(m4_set_symbol_value_text): Adjust fast accessor.
(m4_get_symbol_value_quote_age): New fast accessor.
* m4/symtab.c (m4_set_symbol_value_text): Add parameter.
(m4_get_symbol_value_quote_age): New function.
(m4_symbol_value_copy): Adjust callers.
* m4/macro.c (expand_token): Add parameter, and track quote age.
(expand_argument, collect_arguments): Track quote age.
(m4_macro_expand_input, process_macro, m4_make_argv_ref)
(m4_macro_expand_input): Update callers.
(m4_arg_text, m4_arg_len, m4_arg_func): Abort on type mismatch.
* m4/input.c: Comment cleanups.
(struct m4_input_block): Reduce size.
(m4__next_token): Report quote age.
(m4_push_builtin, init_builtin_token): Update callers.
* m4/utility.c (skip_space): Adjust callers.
* m4/module.c (install_macro_table): Likewise.
* m4/syntax.c (m4_set_syntax): Initialize and update quote age.
(m4_set_quotes, m4_set_comment): Detect no-op changes, and update
quote age.
(set_quote_age): New helper function.
(check_is_single_quotes, check_is_single_comments): Adjust
callers.
* src/freeze.c (reload_frozen_state): Likewise.
* src/main.c (main): Likewise.
* modules/m4.c (define, pushdef): No need to set macro text.
* tests/builtins.at (changequote, defn): New tests.
* examples/wrapfifo.m4: New file.
* examples/wraplifo.m4: New file.
* Makefile.am (dist_pkgdata_DATA): Distribute new examples.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-12-07 07:10:20 -07:00
Eric Blake
8cf99d7ccd Test more corner cases.
* tests/macros.at (Rescanning macros): Beef up test.
* doc/m4.texinfo (Changecom): Beef up test.
(Improved foreach): Document alternate foreachq style.
* examples/foreachq3.m4: New file.
* examples/loop.m4: New file.
* Makefile.am (dist_pkgdata_DATA): Distribute them.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-31 09:52:02 -06:00
Eric Blake
ce70fa8edd Document quoting pitfalls in capitalize.
* doc/m4.texinfo (Patsubst): Use the examples directory.  Also
document shortfall.
(Improved capitalize): New node.
* examples/capitalize.m4: Update to match manual.
* examples/capitalize2.m4: New file.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-06 07:11:18 -06:00
Eric Blake
b9ade95dc1 Create .gitignore alongside .cvsignore.
* bootstrap (version control): Update to reflect git usage.

Signed-off-by: Eric Blake <ebb9@byu.net>
2007-10-06 07:08:53 -06:00
Eric Blake
0dd37af355 * tests/generate.awk (normalize): Update recognition of trailing
spaces in tests.
* doc/m4.texinfo: Minor formatting fixes from branch.
(Foreach, Improved foreach): Merge from branch.
* examples/foreach.m4: Merge from branch.
* examples/foreachq.m4: New file from branch.
* examples/foreach2.m4: Likewise.
* examples/foreachq2.m4: Likewise.
2007-10-06 07:07:10 -06:00
Eric Blake
b9d7924e31 * tests/generate.awk: For ease of doc-writing, simplify selection
of '-Ipath/to/examples' to '@comment examples'.
* examples/forloop.m4: Simplify.
* examples/forloop2.m4: New file.
* examples/quote.m4: New file.
* doc/m4.texinfo (Improved forloop): New node.
(Manual): Clarify use of examples directory.
(Shift, Forloop): Resync from branch.
(Include, Location): Update to new usage of examples directory.
2007-10-06 07:07:07 -06:00
Eric Blake
cb0876cdf6 Avoid all global variables in modules, so that --disable-static
can work on cygwin.
* examples/incl.m4: New file, from branch.
* Makefile.am (dist_pkgdata_DATA): Distribute it.
* doc/m4.texinfo (Location): Merge this section from branch.
(Include): Update the test.
* tests/generate.awk (new_test): Allow for VPATH build
pre-processing of expected __program__ output.
* m4/m4module.h (m4_current_diversion, m4_output_current_line):
Avoid global variables.
(m4_context_field_table): Add current_diversion, output_line.
(m4_output_init, m4_make_diversion): Add parameter.
(m4_get_program_name, m4_set_program_name): New accessors.
* m4/m4private.h (m4_get_current_diversion),
(m4_set_current_diversion, m4_get_output_line)
(m4_set_output_line): New accessors.
* m4/utility.c (m4_get_program_name, m4_set_program_name): New
methods.
* modules/m4.c (divnum, divert): Adjust callers.
* modules/gnu.c (__program__): Likewise.
* m4/output.c (m4_output_init, m4_make_diversion)
(m4_freeze_diversio
2007-10-06 06:59:05 -06:00
Eric Blake
8a80617bda * configure.ac (AM_INIT_AUTOMAKE): Bump automake requirement.
* AUTHORS: Add copyright.
* ChangeLog: Likewise.
* README: Likewise.  Require automake 1.9b or later.
* HACKING: New file.
* README-alpha: Add copyright.
* THANKS: Likewise.  Update.
* doc/STYLE: Add copyright, and tweak for changed directories.
* modules/README: Add copyright, and tweak for libtool version.
* examples/COPYING: New file.
* examples/WWW/COPYING: Likewise.
* examples/WWW/m4lib/COPYING: Likewise.
* modules/shadow.m4: Add copyright.
* modules/perl.m4: Likewise.
* modules/modtest.m4: Likewise.
* modules/stdlib.m4: Likewise.
* modules/time.m4: Likewise.
* modules/time2.m4: Likewise.
* po/Makevars: Likewise.
* tests/iso8859.m4: Likewise.
* tests/m4.in: Likewise.
* NEWS: Add (C) to copyright.
* TODO: Likewise.
* m4/system_.h: Likewise.
* tests/atlocal.in: Likewise.
* tests/builtins.at: Likewise.
* tests/freeze.at: Likewise.
* tests/generate.awk: Likewise.
* tests/macros.at: Likewise.
* tests/modules.at: L
2007-10-06 06:53:09 -06:00
Gary V. Vaughan
0bed0cfbcc Gnulib has changed again. Reimport. Adjust. Rinse. Repeat.
Automake and Libtool now agree on subdir-objects and LTLIBOBJS,
and libtoolize does a better job of ltdl importing now too, so
take advantage of that while updating the tree:

* acm4, config: Moved from here...
* ltdl/m4, ltdl/config: ...to here.
* doc/Makefile.am, m4/Makefile.am, modules/Makefile.am,
src/Makefile.am, tests/Makefile.am: Removed...
* Makefile.am: ...and migrated to here, with adjustments to
compensate for relative path differences.
* commit: Adjust relative paths.
* configure.ac: Adjust relative paths.
(AC_PREREQ): 2.59 isn't strictly new enough, we also need a
patch.
(LT_PREREQ): 2.0 isn't released yet, but will work when it is!  In
the meanwhile, CVS HEAD libtool is needed.
(AM_INIT_AUTOMAKE): Added subdir-objects declaration. 1.9.5 isn't
stricly new enough, we also need a patch.
(AM_PROG_CC_C_O): Required for subdir-objects in Automake.
(AC_WITH_LTDL): Replaced with LT_WITH_LTDL.
(gl_MODULES): Don't list getopt and version-etc, as they don't
belong in libm4.
* bootstrap: After running gnulib-tool to import the listed
modules, fetch getopt and version-etc into src manually.
(ltdldir): Change to ltdl.
* src/main.c: Adjust for changes in version-etc API.
* ltdl/m4/m4-getopt.m4: New macro to mirror gnulib's getopt.m4,
but works when the getopt module isn't to be included in the lib.
* README: Add note about patching autoconf and automake to
bootstrap CVS m4.
2007-10-05 22:01:04 -06:00
Gary V. Vaughan
e46a681a9f The FSF are moving offices today. Changed their contact address
in all files from `59 Temple Place, Suite 330, MA 02111-1307' to
`51 Franklin Street, Fifth Floor, MA 02110-1301'.
2007-10-05 22:01:03 -06:00
Gary V. Vaughan
c0e7fbef55 * m4/stdbool_.h: New file from gnulib for systems without their
own.
* m4/Makefile.am: Add snippets from gnulib for C99 bool support.
* config/stdbool.m4: New file.  Macros from gnulib for same.
* configure.ac: Use it.
2007-10-05 22:00:21 -06:00
Akim Demaille
b4a6393882 * examples/indir.m4, tests/others.at (indir): s/nonsens/nonsense/. 2007-10-05 17:20:27 -06:00
Akim Demaille
f2f6afbc0d * tests/Makefile.am (CLEANFILES): Remove.
(DISTCLEANFILES, clean-local): New.
* examples/mktests.sh: Remove.
2007-10-05 17:20:21 -06:00
Akim Demaille
81f23173cd * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
Don't use aclocal: it's written by hand.
* aclocal.m4: m4_include all the files instead of being built by
aclocal.
* bootstrap: Help automake find the AC_SUBSTs and AM_CONDITIONALs
until it reads the traces by itself.
* configure.in: Require Autoconf 2.42c as we are now using
AC_CONFIG_TESTDIR instead of AT_CONFIG.
Catch unexpanded `jm_' macros.
* config/atconfig.m4: Remove.
* config/error.m4: new.
* config/Makefile.am: Ship the files included by aclocal.m4.
* tests/Makefile.am (TESTSUITE_SOURCES): Rename as...
(TESTSUITE_AT): this, to please Automake.
(TESTSUITE): This target uses autotest/autotest.m4, not
autotest/general.m4.
* tests/testsuite.at: Prereq Autotest 2.52c.
* examples/Makefile.am (pkgdata_DATA): Rename as...
(dist_pkgdata_DATA): this.
* doc/Makefile.am (man_MANS): Rename as...
(dist_man_mans): this.
2007-10-05 17:18:52 -06:00
Akim Demaille
122542adf4 * examples/include.m4: Typo.
* tests/generate.awk: Really add it.
* tests/Makefile.am: Adjust.
* tests/others.at (Discard comments): It sure fails without `-c'.
(include, undivert): Add -I examples/.
2007-10-05 17:18:48 -06:00
Akim Demaille
c0f68e4015 Start using Autotest. atconfig creation is still lacking.
* examples/patsubst.m4, modules/modtest.m4, modules/shadow.m4,
* examples/reverse.m4, tests/other-tests/import-environment.m4,
* tests/other-tests/iso8859.m4: Don't produce trailing blanks.
* tests/other-tests/import-environment.test: Don't check LANGUAGE
as it might be `unset', or set to `C'.
* tests/other-tests/iso8859.test, tests/other-tests/modpath1.test,
* tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
* tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
* tests/other-tests/patsubst.test, tests/other-tests/reverse.test,
* tests/other-tests/shadow.test: Adjust.
* tests/testsuite.at, tests/others.at: New.
* tests/Makefile.am: Adjust.
2007-10-05 17:08:49 -06:00
Akim Demaille
d807e5bf71 More ignores, and fix some typos. 2007-10-05 17:02:28 -06:00
Gary V. Vaughan
e3edaa5279 Consolidate the myriad of dispersed test scripts into the
tests subdirectory.  I think I now have all the file where I
want them, so there shouldn't be anymore upheaval =)O|
Honest!
* tests/Makefile.am: Updated to run the new tests added below.
* tests/other-tests/capitalize.test, tests/other-tests/comments.test,
tests/other-tests/ddivert.test, tests/other-tests/debug.test,
tests/other-tests/esyscmd.test, tests/other-tests/exp.test,
tests/other-tests/foreach.test, tests/other-tests/forloop.test,
tests/other-tests/frozen.m4, tests/other-tests/fstab.test,
tests/other-tests/hanoi.test, tests/other-tests/include.test,
tests/other-tests/indir.test, tests/other-tests/misc.test,
tests/other-tests/modfreeze.test, tests/other-tests/modpath1.test,
tests/other-tests/modpath2.test, tests/other-tests/modpath3.test,
tests/other-tests/modpath4.test, tests/other-tests/modtest.test,
tests/other-tests/multiquotes.test, tests/other-tests/patsubst.test,
tests/other-tests/pushpop.test, tests/oth
2007-10-05 16:57:55 -06:00
Gary V. Vaughan
1691fa49fb Modularization of all builtins by extenstion of libm4. 2007-10-05 16:43:07 -06:00
Gary V. Vaughan
c2f262a05a Resynchronise with my local tree. 2007-10-05 16:35:57 -06:00
Jeff Bailey
bd11691d65 Initial revision 2000-02-17 03:03:19 +00:00