* Get a "blob" of characters. Used for regex and filename tokens. */
| 741 | * Get a "blob" of characters. Used for regex and filename tokens. |
| 742 | */ |
| 743 | int Parser::getBlob() |
| 744 | { |
| 745 | if (peek != TOKEN_ERROR) |
| 746 | unexpectedToken(); |
| 747 | while (isspace(buf[pos])) |
| 748 | pos++; |
| 749 | if (buf[pos] == '\"') |
| 750 | return getToken(); |
| 751 | unsigned j; |
| 752 | for (j = 0; j < TOKEN_MAXLEN && buf[pos] != '\0'; j++) |
| 753 | { |
| 754 | if (isspace(buf[pos])) |
| 755 | break; |
| 756 | if (buf[pos] == '\\' && isspace(buf[pos+1])) |
| 757 | { |
| 758 | s[j] = buf[pos+1]; |
| 759 | pos += 2; |
| 760 | continue; |
| 761 | } |
| 762 | s[j] = buf[pos++]; |
| 763 | } |
| 764 | if (j >= TOKEN_MAXLEN) |
| 765 | unexpectedToken(); |
| 766 | s[j] = '\0'; |
| 767 | return TOKEN_STRING; |
| 768 | } |
| 769 |
no test coverage detected