From 85316049dc6aab23cbe7a5ff3a044c1074786f05 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Mon, 25 Jun 2018 13:33:45 -0400 Subject: [PATCH] sketch out interface for package API --- source/sclpl.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/source/sclpl.h b/source/sclpl.h index 3337e8f..0710b52 100644 --- a/source/sclpl.h +++ b/source/sclpl.h @@ -172,6 +172,35 @@ char* var_name(AST* var); AST* var_value(AST* var); bool var_const(AST* var); +/* Package Definition + *****************************************************************************/ +typedef struct Require { + struct Require* next; + char* path; + char* alias; +} Require; + +typedef struct Provide { + struct Provide* next; + char* name; +} Provide; + +typedef struct File { + struct File* next; + char* name; + SymTable* syms; +} File; + +typedef struct { + char* name; + SymTable* syms; + File* files; +} Package; + +pkg_add_require(Package* p, char* req); +pkg_add_provide(Package* p, char* exp); +pkg_add_definition(Package* p, AST* ast); + /* Pretty Printing *****************************************************************************/ void pprint_token_type(FILE* file, Tok* token); -- 2.54.0