From 3a8b4109241a31ccbf6008ebdc62fff727db735e Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Thu, 2 May 2002 16:16:11 +0000 Subject: [PATCH] * src/reader.c (parse_braces): Merge into... (parse_action): this. --- ChangeLog | 5 +++++ src/reader.c | 26 ++++++++++---------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b5da95e..4f0f2ca0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-05-02 Akim Demaille + + * src/reader.c (parse_braces): Merge into... + (parse_action): this. + 2002-05-02 Akim Demaille * configure.in (ALL_LINGUAS): Remove. diff --git a/src/reader.c b/src/reader.c index 1ce5f51f..da97aa41 100644 --- a/src/reader.c +++ b/src/reader.c @@ -1264,22 +1264,24 @@ read_declarations (void) /*------------------------------------------------------------------. | Assuming that a `{' has just been seen, copy everything up to the | -| matching `}' into the actions file. RULE_LENGTH is the number of | -| values in the current rule so far, which says where to find `$0' | -| with respect to the top of the stack. | +| matching `}' into ACTION_OBSTACK. | +| | +| RULE_LENGTH is the number of values in the current rule so far, | +| which says where to find `$0' with respect to the top of the | +| stack. It is not the same as the rule->length in the case of mid | +| rule actions. | | | | This routine is used for actions. | `------------------------------------------------------------------*/ static void -parse_braces (symbol_list *rule, int rule_length) +parse_action (symbol_list *rule, int rule_length) { - int c; - int count; - - count = 1; + int count = 1; + rule->action_line = lineno; while (count > 0) { + int c; while ((c = getc (finput)) != '}') switch (c) { @@ -1323,14 +1325,6 @@ parse_braces (symbol_list *rule, int rule_length) } obstack_1grow (&action_obstack, '\0'); -} - - -static void -parse_action (symbol_list *rule, int rule_length) -{ - rule->action_line = lineno; - parse_braces (rule, rule_length); rule->action = obstack_finish (&action_obstack); } -- 2.47.2