X-Git-Url: https://www.kengrimes.com/gitweb/?p=henge%2Fapc.git;a=blobdiff_plain;f=src%2Flexer.rl;h=920d62dafc5048b7b2ea2c2987c3adee8a7c66c0;hp=c7600aecdeb93be1d9603eda873b9b9dfcb0d545;hb=7dae7dc73dfbabdc895a78738f550f56561da644;hpb=43f088652419e08b7426b2c689591b280c0f2330 diff --git a/src/lexer.rl b/src/lexer.rl index c7600ae..920d62d 100644 --- a/src/lexer.rl +++ b/src/lexer.rl @@ -141,18 +141,11 @@ int lexer_lexstring { uint8_t* p, * ts, * pe, * eof; int cs, ntok; YYSTYPE lval; - ntok = 0; p = ts = str; pe = eof = p + size + 1; - - dprintf("\n|---Begin lexstring on p = %U, pe = %p.---|\n",p, pe); - %%write init; %%write exec; - - dprintf("\n|---Ending lexstring of file %U, pushed %d tokens.---|\n",str, ntok); - return ntok; } @@ -177,6 +170,7 @@ int lexer_lexfile // Mark the end of the filename filename_end = iter; // Lex from either the last period, if present, or filename end + dprintf("%U\n\t",filename); ntok = (last_period) ? lexer_lexstring(filename, (int)(last_period - filename)) : lexer_lexstring(filename, (int)(iter - filename)); @@ -185,6 +179,7 @@ int lexer_lexfile if (*iter == '\0') *iter = '_'; PUSHPATH(filename); + dprintf("\n\t[%i Token%s]\n", ntok, (ntok > 1) ? "s" : ""); return ntok + 1; } @@ -192,14 +187,18 @@ int lexer_lexdir ( uint8_t* dirname ) { int ntok; ntok = 0; + if (DEBUG) putchar('\t'); PUSHNAME(dirname); PUSHOP(CLOPEN); + if (DEBUG) putchar('\n'); return ntok; } int lexer_closedir ( void ) { int ntok = 0; + if (DEBUG) putchar('\t'); PUSHOP(CLCLOSE); + if (DEBUG) putchar('\n'); return ntok; }