X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fccltoken.c;h=c4f0a601ead32f37d89b6f75e0e64a3d684d59c6;hb=30d210952d2f8b305f9f79e637a4db53dcf0873c;hp=06ff2a78c8b3a89c127a6dbb13e85334ac1504fd;hpb=e4baade57ba02d625ecd6452b0f4383b24c25f2d;p=yaz-moved-to-github.git diff --git a/src/ccltoken.c b/src/ccltoken.c index 06ff2a7..c4f0a60 100644 --- a/src/ccltoken.c +++ b/src/ccltoken.c @@ -41,10 +41,14 @@ * USE OR PERFORMANCE OF THIS SOFTWARE. * */ +/** + * \file ccltoken.c + * \brief Implements CCL lexical analyzer (scanner) + */ /* CCL - lexical analysis * Europagate, 1995 * - * $Id: ccltoken.c,v 1.3 2004-09-29 20:37:50 adam Exp $ + * $Id: ccltoken.c,v 1.6 2005-03-15 16:32:52 adam Exp $ * * Old Europagate Log: * @@ -201,12 +205,13 @@ struct ccl_token *ccl_token_simple (const char *command) struct ccl_token *ccl_parser_tokenize (CCL_parser cclp, const char *command) { const char *aliases; - const unsigned char *cp = command; + const unsigned char *cp = (const unsigned char *) command; struct ccl_token *first = NULL; struct ccl_token *last = NULL; while (1) { + const unsigned char *cp0 = cp; while (*cp && strchr (" \t\r\n", *cp)) { cp++; @@ -225,8 +230,10 @@ struct ccl_token *ccl_parser_tokenize (CCL_parser cclp, const char *command) last->next->prev = last; last = last->next; } + last->ws_prefix_buf = cp0; + last->ws_prefix_len = cp - cp0; last->next = NULL; - last->name = cp; + last->name = (const char *) cp; last->len = 1; switch (*cp++) { @@ -267,7 +274,7 @@ struct ccl_token *ccl_parser_tokenize (CCL_parser cclp, const char *command) break; case '\"': last->kind = CCL_TOK_TERM; - last->name = cp; + last->name = (const char *) cp; last->len = 0; while (*cp && *cp != '\"') {