-#if defined (DPAREN_ARITHMETIC)
- /* Parse a ksh-style ((...)) expression. */
- if (parser_state & PST_DBLPAREN)
- {
- int exp_lineno;
-
- /* If we've already consumed a right paren that should be part of
- the expression, push it back so the paren matching code won't
- return prematurely. */
- if (character == '(') /* ) */
- shell_ungetc (character);
- exp_lineno = line_number;
- ttok = parse_matched_pair (0, '(', ')', &ttoklen, 0);
- parser_state &= ~PST_DBLPAREN;
- if (ttok == &matched_pair_error)
- return -1;
- /* Check that the next character is the closing right paren. If
- not, this is a syntax error. ( */
- if (shell_getc (0) != ')')
- {
- FREE (ttok); /* ( */
- parser_error (exp_lineno, "missing closing `)' for arithmetic expression");
- return -1;
- }
- RESIZE_MALLOCED_BUFFER (token, token_index, ttoklen + 4,
- token_buffer_size, TOKEN_DEFAULT_GROW_SIZE);
- token[token_index++] = '"';
- if (character != '(') /* ) */
- token[token_index++] = character;
- strncpy (token + token_index, ttok, ttoklen - 1);
- token_index += ttoklen - 1;
- token[token_index++] = '"';
- FREE (ttok);
- dollar_present = all_digits = 0;
- quoted = 1;
- goto got_token;
- }
-#endif /* DPAREN_ARITHMETIC */
-