while (words[i] && words[i] != ')') ++i;
int depth = 0; while (words[i] && !(depth == 0 && words[i] == ')')) { if (words[i] == '(') ++depth; else if (words[i] == ')') --depth;  ++i; }
parse_dollars (char **word, size_t *word_length, size_t *max_length,	       const char *words, size_t *offset, int flags,	       wordexp_t *pwordexp, const char *ifs, const char *ifs_white,	       int quoted){  /* We are poised _at_ "$" */  switch (words[1 + *offset])    {    case '"':    case '\'':    case 0:      *word = w_addchar (*word, word_length, max_length, '$');      return *word ? 0 : WRDE_NOSPACE;    case '(':      if (words[2 + *offset] == '(')	{	  /* Differentiate between $((1+3)) and $((echo);(ls)) */	  int i = 3 + *offset;	  while (words[i] && words[i] != ')')	    ++i;	  if (words[i] == ')' && words[i + 1] == ')')	    {	      (*offset) += 3;	      /* Call parse_arith -- 0 is for "no brackets" */	      return parse_arith (word, word_length, max_length, words, offset,				  flags, 0);	    }	}      if (flags & WRDE_NOCMD)	return WRDE_CMDSUB;      (*offset) += 2;      return parse_comm (word, word_length, max_length, words, offset, flags,			 quoted? NULL : pwordexp, ifs, ifs_white);    case '[':      (*offset) += 2;      /* Call parse_arith -- 1 is for "brackets" */      return parse_arith (word, word_length, max_length, words, offset, flags,			  1);    case '{':    default:      ++(*offset);	/* parse_param needs to know if "{" is there */      return parse_param (word, word_length, max_length, words, offset, flags,			   pwordexp, ifs, ifs_white, quoted);    }}