Browse Source

distinguish the quote character from quoted symbols

master
nisstyre56 10 years ago
parent
commit
863d62623f
  1. 10
      tokenize.c

10
tokenize.c

@ -14,21 +14,21 @@
*/ */
static const token_t nulltok = { static const token_t nulltok = {
.token_type=EMPTY, .token_type = EMPTY,
{ {
.null_token=false .null_token=false
} }
}; };
static const token_t whitespace_tok = { static const token_t whitespace_tok = {
.token_type=WSPACE, .token_type = WSPACE,
.token= { .token= {
.whitespace=true .whitespace=true
} }
}; };
static const token_t quote_tok = { static const token_t quote_tok = {
.token_type=QUOTE, .token_type = QUOTE,
.token= { .token= {
.quote=true .quote=true
} }
@ -272,10 +272,10 @@ match_symbol(source_t source,
return false; return false;
} }
i++; i++;
while (!isspace(source[i]) && i <= length) { while (!isspace(source[i]) && i < length) {
i++; i++;
} }
if (i == begin) { if (i == begin+1) { /* if we did not increment i more than once (before the loop) */
return false; return false;
} }
return i; return i;