diff options
author | Camil Staps | 2016-09-24 15:14:01 +0200 |
---|---|---|
committer | Camil Staps | 2016-09-24 15:16:01 +0200 |
commit | e08cc0aa5f0eb0b99fb553623dd0600cf8aeb572 (patch) | |
tree | 5703244ba6b1016185597979b64f241d1fb66f85 | |
parent | Remove unnecessary dependency (diff) |
Made parse_file implementation dependent
-rw-r--r-- | interpreter/fuspel.c | 4 | ||||
-rw-r--r-- | interpreter/fuspel.h | 2 | ||||
-rw-r--r-- | interpreter/parse.c | 5 | ||||
-rw-r--r-- | interpreter/syntax.h | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/interpreter/fuspel.c b/interpreter/fuspel.c index b976772..3015db5 100644 --- a/interpreter/fuspel.c +++ b/interpreter/fuspel.c @@ -9,7 +9,7 @@ #define LINE_LENGTH 139 -fuspel* parse_file(fuspel* already_parsed, char* fname) { +fuspel* import(fuspel* already_parsed, char* fname) { token_list* tokens = NULL; fuspel* pgm; FILE* f; @@ -67,7 +67,7 @@ int main(int argc, char* argv[]) { } for (i = 1; i < argc; i++) { - pgm = parse_file(pgm, argv[i]); + pgm = import(pgm, argv[i]); } if (!pgm) { diff --git a/interpreter/fuspel.h b/interpreter/fuspel.h index fea191d..cc7a3a7 100644 --- a/interpreter/fuspel.h +++ b/interpreter/fuspel.h @@ -1,6 +1,6 @@ #ifndef _H_FUSPEL #define _H_FUSPEL -fuspel* parse_file(fuspel* already_parsed, char* fname); +fuspel* import(fuspel* already_parsed, char* name); #endif diff --git a/interpreter/parse.c b/interpreter/parse.c index 3a611e8..e0953d1 100644 --- a/interpreter/parse.c +++ b/interpreter/parse.c @@ -3,10 +3,11 @@ #include <string.h> #include "code.h" -#include "fuspel.h" #include "log.h" #include "mem.h" +extern fuspel* import(fuspel* already_parsed, char* name); + token_list* parse_name(char** name, token_list* list) { if (list->elem.kind != TOKEN_NAME) return NULL; @@ -260,7 +261,7 @@ fuspel* parse(token_list* list) { list = list->rest; if (!list || list->elem.kind != TOKEN_NAME) return NULL; - rules = parse_file(rules, list->elem.var); + rules = import(rules, list->elem.var); if (!rules) return NULL; diff --git a/interpreter/syntax.h b/interpreter/syntax.h index 7fae574..0944842 100644 --- a/interpreter/syntax.h +++ b/interpreter/syntax.h @@ -40,7 +40,7 @@ typedef enum { var2: pointer to unsigned char (nr. of arguments) */ EXPR_LIST, /* var1, var2: pointers to expression OR (nil) */ EXPR_TUPLE, /* var1, var2: pointers to expression */ - EXPR_APP, /* var1, var2: pointers to expression */ + EXPR_APP /* var1, var2: pointers to expression */ } expr_kind; typedef struct { |