From: Michael D. Lowis Date: Mon, 25 Jun 2018 17:33:45 +0000 (-0400) Subject: sketch out interface for package API X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=85316049dc6aab23cbe7a5ff3a044c1074786f05;p=proto%2Fsclpl.git sketch out interface for package API --- 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);