1
0
Fork 0
Browse Source

TokenStream: Remove scriptcall member

master
Marrub 6 years ago
parent
commit
95c85fdb9f
  1. 2
      lithos_c/inc/Lth_tokenstream.h
  2. 14
      lithos_c/src/tokenstream.c

2
lithos_c/inc/Lth_tokenstream.h

@ -31,7 +31,6 @@
// read-write
// skipeol: Skip line end tokens.
// skipspc: Skip whitespace tokens.
// scriptcall: Calls Lth_TokenGet via a script to reduce instructions. Slow.
//
typedef struct Lth_TokenStream
{
@ -41,7 +40,6 @@ typedef struct Lth_TokenStream
bool skipeol;
bool skipspc;
bool scriptcall;
} Lth_TokenStream;

14
lithos_c/src/tokenstream.c

@ -133,14 +133,6 @@ static FILE *Lth_TokenFileStreamOpen(void *data, size_t size)
return fopencookie(cookie, "r", io_funcs);
}
//
// Lth_TokenGet_Script
//
Lth_ScriptCall static void Lth_TokenGet_Script(FILE *fp, Lth_Token *out)
{
Lth_TokenGet(fp, out);
}
//
// Lth_TokenStreamGrab
//
@ -148,11 +140,7 @@ static void Lth_TokenStreamGrab(Lth_TokenStream *stream)
{
if(feof(stream->fp)) return;
bool scriptcall = stream->scriptcall;
do
if(!scriptcall) Lth_TokenGet(stream->fp, &stream->tokbuf);
else Lth_TokenGet_Script(stream->fp, &stream->tokbuf);
do Lth_TokenGet(stream->fp, &stream->tokbuf);
while((stream->skipspc && stream->tokbuf.type == Lth_TOK_Space) ||
(stream->skipeol && stream->tokbuf.type == Lth_TOK_LnEnd));

Loading…
Cancel
Save