* debackslash - * create a palloc'd string holding the given token. * any protective backslashes in the token are removed. */
| 238 | * any protective backslashes in the token are removed. |
| 239 | */ |
| 240 | char * |
| 241 | debackslash(const char *token, int length) |
| 242 | { |
| 243 | char *result = palloc(length + 1); |
| 244 | char *ptr = result; |
| 245 | |
| 246 | while (length > 0) |
| 247 | { |
| 248 | if (*token == '\\' && length > 1) |
| 249 | token++, length--; |
| 250 | *ptr++ = *token++; |
| 251 | length--; |
| 252 | } |
| 253 | *ptr = '\0'; |
| 254 | return result; |
| 255 | } |
| 256 | |
| 257 | #define RIGHT_PAREN (1000000 + 1) |
| 258 | #define LEFT_PAREN (1000000 + 2) |
no test coverage detected