From f71db70bce0f70517928d2567da829d01a22b402 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Wed, 9 Sep 2009 15:36:02 +0200 Subject: [PATCH] style changes. * src/parse-gram.y (add_param): Scope changes. --- ChangeLog | 5 +++++ src/parse-gram.y | 34 ++++++++++++++++++---------------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index d8a5d80e..8caca3e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-09 Akim Demaille + + style changes. + * src/parse-gram.y (add_param): Scope changes. + 2009-09-09 Akim Demaille %parse: support several arguments. diff --git a/src/parse-gram.y b/src/parse-gram.y index 453c35f8..3e208d1b 100644 --- a/src/parse-gram.y +++ b/src/parse-gram.y @@ -727,23 +727,25 @@ add_param (param_type type, char *decl, location loc) "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "_" "0123456789"; + char const *name_start = NULL; - char *p; - - /* Stop on last actual character. */ - for (p = decl; p[1]; p++) - if ((p == decl - || ! memchr (alphanum, p[-1], sizeof alphanum)) - && memchr (alphanum, p[0], sizeof alphanum - 10)) - name_start = p; - - /* Strip the surrounding '{' and '}', and any blanks just inside - the braces. */ - while (*--p == ' ' || *p == '\t') - continue; - p[1] = '\0'; - while (*++decl == ' ' || *decl == '\t') - continue; + { + char *p; + /* Stop on last actual character. */ + for (p = decl; p[1]; p++) + if ((p == decl + || ! memchr (alphanum, p[-1], sizeof alphanum)) + && memchr (alphanum, p[0], sizeof alphanum - 10)) + name_start = p; + + /* Strip the surrounding '{' and '}', and any blanks just inside + the braces. */ + while (*--p == ' ' || *p == '\t') + continue; + p[1] = '\0'; + while (*++decl == ' ' || *decl == '\t') + continue; + } if (! name_start) complain_at (loc, _("missing identifier in parameter declaration")); -- 2.45.2