-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This will in time be used to load every module (including the main file), making dvc obsolete for anything but compiling the compiler.
- Loading branch information
Showing
6 changed files
with
780 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,7 @@ | |
*.o | ||
vm/std.c | ||
vm/std.vu | ||
vm/compiler.c | ||
vm/compiler.vu | ||
vm/vu | ||
vm/vu-dbg |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
with open('compiler.c', 'w') as f: | ||
f.write('''#include "compiler.h" | ||
/* This file is generated by gencompilerc.py. | ||
* Do not edit by hand. | ||
* Also, this file is automatically updated | ||
* by make when the project is built. | ||
*/ | ||
V load_compiler(V global) | ||
{ | ||
char compiler[] = {''') | ||
with open('compiler.vu', 'rb') as std: | ||
for n, char in enumerate(std.read()): | ||
if n % 8 == 0: | ||
f.write("\n ") | ||
f.write(r"'\x%02x', " % ord(char)) | ||
f.write(''' | ||
}; | ||
return load_memfile(compiler, sizeof compiler, a_to_string("(compiler)"), global); | ||
} | ||
''') |
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.