/[bison]/bison/src/lex.c
ViewVC logotype

Diff of /bison/src/lex.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.56 by akim, Sat May 4 08:48:04 2002 UTC revision 1.57 by akim, Sat May 25 16:12:40 2002 UTC
# Line 484  option_strcmp (const char *left, const c Line 484  option_strcmp (const char *left, const c
484  token_t  token_t
485  parse_percent_token (void)  parse_percent_token (void)
486  {  {
487    const struct option_table_struct *tx = NULL;    const struct option_table_s *tx = NULL;
488    const char *arg = NULL;    const char *arg = NULL;
489    /* Where the ARG was found in token_buffer. */    /* Where the ARG was found in token_buffer. */
490    size_t arg_offset = 0;    size_t arg_offset = 0;
# Line 578  parse_percent_token (void) Line 578  parse_percent_token (void)
578    switch (tx->ret_val)    switch (tx->ret_val)
579      {      {
580      case tok_stropt:      case tok_stropt:
581        assert (tx->set_flag);        assert (tx->flag);
582        if (arg)        if (arg)
583          {          {
584              char **flag = (char **) tx->flag;
585            /* Keep only the first assignment: command line options have            /* Keep only the first assignment: command line options have
586               already been processed, and we want them to have               already been processed, and we want them to have
587               precedence.  Side effect: if this %-option is used               precedence.  Side effect: if this %-option is used
588               several times, only the first is honored.  Bah.  */               several times, only the first is honored.  Bah.  */
589            if (!*((char **) (tx->set_flag)))            if (!*flag)
590              *((char **) (tx->set_flag)) = xstrdup (arg);              *flag = xstrdup (arg);
591          }          }
592        else        else
593          fatal (_("`%s' requires an argument"), token_buffer);          fatal (_("`%s' requires an argument"), token_buffer);
# Line 594  parse_percent_token (void) Line 595  parse_percent_token (void)
595        break;        break;
596    
597      case tok_intopt:      case tok_intopt:
598        assert (tx->set_flag);        assert (tx->flag);
599        *((int *) (tx->set_flag)) = 1;        *((int *) (tx->flag)) = 1;
600        return tok_noop;        return tok_noop;
601        break;        break;
602    

Legend:
Removed from v.1.56  
changed lines
  Added in v.1.57

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26