]> git.mdlowis.com Git - proto/sclpl.git/commitdiff
sketch out interface for package API
authorMichael D. Lowis <mike.lowis@gentex.com>
Mon, 25 Jun 2018 17:33:45 +0000 (13:33 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Mon, 25 Jun 2018 17:33:45 +0000 (13:33 -0400)
source/sclpl.h

index 3337e8f5976d893ffbf6d6d11b6d628667da4af8..0710b52db039a84fef853c94cb85843b075758b4 100644 (file)
@@ -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);