TokenStream: Fix erroneous block comment parsing
parent
7c854b943f
commit
4644b4108c
|
@ -36,11 +36,11 @@ bool Lth_TokenStreamDrop(struct Lth_TokenStream *stream, Lth_TokenTy
|
||||||
// Lth_TokenStream
|
// Lth_TokenStream
|
||||||
//
|
//
|
||||||
// internal data
|
// internal data
|
||||||
// fp
|
|
||||||
// tokbuf
|
// tokbuf
|
||||||
// filled
|
// filled
|
||||||
//
|
//
|
||||||
// read-write
|
// read-write
|
||||||
|
// fp: File that the token stream is parsing.
|
||||||
// skipeol: Skip line end tokens. Defaults to true.
|
// skipeol: Skip line end tokens. Defaults to true.
|
||||||
// skipspc: Skip whitespace tokens. Defaults to true.
|
// skipspc: Skip whitespace tokens. Defaults to true.
|
||||||
//
|
//
|
||||||
|
@ -51,10 +51,10 @@ typedef struct Lth_TokenStream
|
||||||
__prop peek {call: Lth_TokenStreamPeek(this)}
|
__prop peek {call: Lth_TokenStreamPeek(this)}
|
||||||
__prop drop {call: Lth_TokenStreamDrop(this)}
|
__prop drop {call: Lth_TokenStreamDrop(this)}
|
||||||
|
|
||||||
FILE *fp;
|
|
||||||
Lth_Token tokbuf;
|
Lth_Token tokbuf;
|
||||||
bool filled;
|
bool filled;
|
||||||
|
|
||||||
|
FILE *fp;
|
||||||
bool skipeol;
|
bool skipeol;
|
||||||
bool skipspc;
|
bool skipspc;
|
||||||
} Lth_TokenStream;
|
} Lth_TokenStream;
|
||||||
|
|
|
@ -82,7 +82,7 @@ static ssize_t Lth_TokenFileStream_read(void *cookie_, char *buf, size_t size)
|
||||||
cookie->bumpc();
|
cookie->bumpc();
|
||||||
if(cookie->getc() == '*')
|
if(cookie->getc() == '*')
|
||||||
{
|
{
|
||||||
for(cookie->bumpc(); !(cookie->bumpc() == '*' && cookie->getc() == '/');)
|
for(cookie->bumpc(); !(cookie->bumpc() == '*' && cookie->bumpc() == '/');)
|
||||||
if(cookie->getc() == EOF)
|
if(cookie->getc() == EOF)
|
||||||
return i;
|
return i;
|
||||||
buf[i++] = ' ';
|
buf[i++] = ' ';
|
||||||
|
|
Loading…
Reference in New Issue