m4-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: speed up input parsing


From: Eric Blake
Subject: Re: speed up input parsing
Date: Mon, 16 Feb 2009 06:29:48 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Eric Blake on 2/13/2009 6:09 AM:
> While working on argv_ref patch 29, I noticed that the master branch had a
> variable input_change which was always true.  This has been the case ever
> since it was introduced in commit 3883a on 2006-10-25; even though that
> patch was copied from the branch where the variable is properly cleared.

Another stupid one-liner porting bug on my part, this time from commit
726430.  I hadn't noticed it before because autoconf only uses symmetric
multi-character quotes (start and end quote always have the same length).

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmZakwACgkQ84KuGfSFAYADFgCgwo29d4GTMD2ce0geSJhJc7KF
T6kAn2U+Fr0N8eVJlWq3Zri4HD4fHWWi
=MU9L
-----END PGP SIGNATURE-----
>From 9b0812943d025b46fbed585adce8ff11acb39d3a Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Mon, 16 Feb 2009 06:21:20 -0700
Subject: [PATCH] Fix regression in multicharacter quotes, from 2008-01-25.

* m4/input.c (m4__next_token): Fix typo.
* tests/builtins.at (changequote): Enhance test.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog         |    6 ++++++
 m4/input.c        |    2 +-
 tests/builtins.at |    4 ++++
 3 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6717a8a..8997569 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-02-16  Eric Blake  <address@hidden>
+
+       Fix regression in multicharacter quotes, from 2008-01-25.
+       * m4/input.c (m4__next_token): Fix typo.
+       * tests/builtins.at (changequote): Enhance test.
+
 2009-02-13  Eric Blake  <address@hidden>

        Speed up parsing when detecting input file change.
diff --git a/m4/input.c b/m4/input.c
index 2672386..ba2e467 100644
--- a/m4/input.c
+++ b/m4/input.c
@@ -1678,7 +1678,7 @@ m4__next_token (m4 *context, m4_symbol_value *token, int 
*line,
              {
                quote_level++;
                obstack_grow (obs_safe, context->syntax->quote.str1,
-                             context->syntax->quote.len2);
+                             context->syntax->quote.len1);
              }
            else
              obstack_1grow (obs_safe, ch);
diff --git a/tests/builtins.at b/tests/builtins.at
index 397f649..46ce548 100644
--- a/tests/builtins.at
+++ b/tests/builtins.at
@@ -133,11 +133,15 @@ AT_DATA([in.m4],
 [[define(`aaaaaaaaaaaaaaaaaaaa', `A')define(`q', `"$@"')
 changequote(`"', `"')
 q(q("aaaaaaaaaaaaaaaaaaaa", "a"))
+changequote`'define(`echo', `$@')dnl
+changequote(`<<<', `>>')dnl
+echo(<<<a<<<b>>>>)
 ]])

 AT_CHECK_M4([in.m4], [0], [[

 A,a
+a<<<b>>
 ]])

 AT_CLEANUP
-- 
1.6.1.2


reply via email to

[Prev in Thread] Current Thread [Next in Thread]