|
@@ -367,14 +367,12 @@ void consume_ignored(char *source, size_t *pos) {
|
|
|
}
|
|
|
|
|
|
list_t *FILES;
|
|
|
+list_t *REQUIRED;
|
|
|
|
|
|
int is_required(char *path) {
|
|
|
- for (size_t i = 0; i < FILES->length; i++) {
|
|
|
- list_t *pair = FILES->data[i];
|
|
|
-
|
|
|
- if (strcmp(pair->data[0], path) == 0)
|
|
|
+ for (size_t i = 0; i < REQUIRED->length; i++)
|
|
|
+ if (strcmp(REQUIRED->data[i], path) == 0)
|
|
|
return 1;
|
|
|
- }
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -1846,6 +1844,7 @@ void compile_node(buffer_t *gbuf, buffer_t *buf, list_t *ctx, stack_t *lstk, nod
|
|
|
compile_into(source, gbuf, buf, ctx, lstk);
|
|
|
|
|
|
list_pop(FILES);
|
|
|
+ list_push(REQUIRED, path);
|
|
|
} break;
|
|
|
|
|
|
case N_IFEXPR:
|
|
@@ -1962,6 +1961,7 @@ char *compile_file(char *filename, FILE *fd) {
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
FILES = list_new();
|
|
|
+ REQUIRED = list_new();
|
|
|
|
|
|
char *out = compile_file("<stdin>", stdin);
|
|
|
|