[BACK]Return to lexi.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / usr.bin / indent

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/usr.bin/indent/lexi.c between version 1.154 and 1.155

version 1.154, 2021/11/25 08:08:28 version 1.155, 2021/11/25 16:09:02
Line 450  cmp_keyword_by_name(const void *key, con
Line 450  cmp_keyword_by_name(const void *key, con
     return strcmp(key, ((const struct keyword *)elem)->name);      return strcmp(key, ((const struct keyword *)elem)->name);
 }  }
   
   static bool
   probably_looking_at_definition(void)
   {
       for (const char *p = inp_p(), *e = inp_line_end(); p < e;)
           if (*p++ == ')' && (*p == ';' || *p == ','))
               return false;
       return true;
   }
   
 /* Read an alphanumeric token into 'token', or return lsym_eof. */  /* Read an alphanumeric token into 'token', or return lsym_eof. */
 static lexer_symbol  static lexer_symbol
 lexi_alnum(void)  lexi_alnum(void)
Line 508  found_typename:
Line 517  found_typename:
     if (inp_peek() == '(' && ps.tos <= 1 && ps.ind_level == 0 &&      if (inp_peek() == '(' && ps.tos <= 1 && ps.ind_level == 0 &&
         !ps.in_parameter_declaration && !ps.block_init) {          !ps.in_parameter_declaration && !ps.block_init) {
   
         for (const char *p = inp_p(), *e = inp_line_end(); p < e;)          if (probably_looking_at_definition()) {
             if (*p++ == ')' && (*p == ';' || *p == ','))              ps.is_function_definition = true;
                 goto no_function_definition;              if (ps.in_decl)
                   ps.in_parameter_declaration = true;
         ps.is_function_definition = true;              return lsym_funcname;
         if (ps.in_decl)          }
             ps.in_parameter_declaration = true;  
         return lsym_funcname;  
 no_function_definition:;  
   
     } else if (ps.p_l_follow == 0 && probably_typename()) {      } else if (ps.p_l_follow == 0 && probably_typename()) {
         ps.next_unary = true;          ps.next_unary = true;

Legend:
Removed from v.1.154  
changed lines
  Added in v.1.155

CVSweb <webmaster@jp.NetBSD.org>