-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added module system by introducing the import statement and #export d…
…irective.
- Loading branch information
1 parent
c8eb61b
commit 6d0dba7
Showing
10 changed files
with
429 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
#ifndef FILES_H | ||
#define FILES_H | ||
|
||
#include "stdbool.h" | ||
|
||
#include "c-utils/darray.h" | ||
#include "lexer.h" | ||
|
||
typedef struct Compilation_Unit Compilation_Unit; | ||
|
||
typedef struct File_Data { | ||
char *filename; | ||
char *contents; | ||
bool parsed; | ||
Token_Array tokens; | ||
Compilation_Unit *module; | ||
} File_Data; | ||
|
||
GENERATE_DARRAY_HEADER(File_Data, File_Array); | ||
|
||
extern File_Array files; | ||
|
||
void init_file_array(void); | ||
char *add_file(char *filename); | ||
int add_file(char *filename); | ||
|
||
#endif /* end of include guard: FILES_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,7 @@ typedef enum Token_Type { | |
TFN, | ||
TSTRUCT, | ||
TFOREIGN, | ||
TIMPORT, | ||
TRETURN, | ||
TIF, | ||
TELSE, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.