diff options
Diffstat (limited to 'parser.c')
-rw-r--r-- | parser.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -86,6 +86,7 @@ parse(int fd) print("Could not open file\n"); return nil; } + initgoals = nil; initoperators(); nexttoken(); @@ -105,8 +106,13 @@ prologtext(void) syntaxerror("prologtext"); if(t->tag == CompoundTerm && runestrcmp(t->text, L":-") == 0 && t->arity == 1){ - /* A Directive */ - print("Got directive: %S\n", prettyprint(t)); + Term *body = t->children; + print("Got directive: %S\n", prettyprint(body)); + if(body->tag == CompoundTerm && body->arity == 1 && runestrcmp(body->text, L"initialization") == 0){ + Term *tmp = initgoals; + initgoals = body->children; + initgoals->next = tmp; + } t = prologtext(); }else if(t->tag == CompoundTerm && runestrcmp(t->text, L":-") == 0 && t->arity == 2){ t->next = prologtext(); |