MCPcopy Create free account
hub / github.com/GJDuck/e9patch / getBlob

Method getBlob

src/e9tool/e9parser.cpp:743–768  ·  view source on GitHub ↗

* Get a "blob" of characters. Used for regex and filename tokens. */

Source from the content-addressed store, hash-verified

741 * Get a "blob" of characters. Used for regex and filename tokens.
742 */
743int 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

Callers 1

parsePatchFunction · 0.80

Calls 3

unexpectedTokenFunction · 0.85
isspaceFunction · 0.85
getTokenFunction · 0.85

Tested by

no test coverage detected