#include <assert.h>
#include <errno.h>
#include <stdarg.h>
+#include <time.h>
#include <Zend/zend_smart_str.h>
memset(fb->buffer + sb.st_size, 0, psi_parser_maxfill());
+ fb->lmod = sb.st_mtime;
fb->length = sb.st_size;
fb->file = psi_string_init_interned(filename, strlen(filename), 1);
memcpy(sb->buffer, string, length);
memset(sb->buffer + length, 0, psi_parser_maxfill());
+ sb->lmod = time(NULL);
sb->length = length;
sb->file = psi_string_init_interned("<stdin>", strlen("<stdin>"), 1);
struct psi_plist *psi_parser_preprocess(struct psi_parser *P,
struct psi_plist **tokens)
{
- if (psi_cpp_process(P->preproc, tokens)) {
+ if (psi_cpp_process(P->preproc, tokens, NULL)) {
return *tokens;
}
return NULL;
if (!cnst) {
continue;
}
-//fprintf(stderr, "PARSE: %s", ZSTR_VAL(cnst));
+
I = psi_parser_open_string(P, ZSTR_VAL(cnst), ZSTR_LEN(cnst));
zend_string_release(cnst);
struct psi_plist *scanned, *preproc;
size_t processed = 0;
+ P->input = I;
+
if (!(scanned = psi_parser_scan(P, I))) {
+ P->input = NULL;
return false;
}
if (!(preproc = psi_parser_preprocess(P, &scanned))) {
+ P->input = NULL;
psi_plist_free(scanned);
return false;
}
if (!psi_parser_process(P, preproc, &processed)) {
+ P->input = NULL;
psi_plist_free(preproc);
return false;
}
psi_parser_postprocess(P);
psi_plist_free(preproc);
+ P->input = NULL;
return true;
}