more PLStream stuff.

This commit is contained in:
Vítor Santos Costa
2011-02-23 17:46:50 +00:00
parent 6ea0b727e0
commit f92fa69eab
7 changed files with 33 additions and 8 deletions

View File

@@ -4681,6 +4681,8 @@ static const PL_extension foreigns[] = {
FRG("format_predicate", 2, pl_format_predicate, META),
FRG("current_format_predicate", 2, pl_current_format_predicate,
META|NDET),
FRG("$raw_read", 1, pl_raw_read, 0),
FRG("$raw_read", 2, pl_raw_read2, 0),
/* DO NOT ADD ENTRIES BELOW THIS ONE */
LFRG((char *)NULL, 0, NULL, 0)
};

View File

@@ -28,7 +28,6 @@ typedef struct
unsigned char *base; /* base of clause */
unsigned char *end; /* end of the clause */
unsigned char *token_start; /* start of most recent read token */
IOSTREAM *stream;
int has_exception; /* exception is raised */
unsigned char *posp; /* position pointer */
@@ -37,6 +36,7 @@ typedef struct
unsigned int flags; /* Module syntax flags */
int styleCheck; /* style-checking mask */
bool backquoted_string; /* Read `hello` as string */
int *char_conversion_table; /* active conversion table */
term_t exception; /* raised exception */
@@ -70,7 +70,7 @@ init_read_data(ReadData _PL_rd, IOSTREAM *in ARG_LD)
{ memset(_PL_rd, 0, sizeof(*_PL_rd)); /* optimise! */
_PL_rd->varnames = 0;
_PL_rd->stream = in;
rb.stream = in;
_PL_rd->has_exception = 0;
_PL_rd->exception = 0;
}
@@ -81,9 +81,9 @@ free_read_data(ReadData _PL_rd)
}
static int
read_term(term_t t, ReadData rd ARG_LD)
read_term(term_t t, ReadData _PL_rd ARG_LD)
{
return Yap_read_term(t, rd->stream, rd->varnames);
return Yap_read_term(t, rb.stream, _PL_rd->varnames);
}