Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (20 sloc) 512 Bytes
with open('std.c', 'w') as f:
f.write('''#include "std.h"
/* This file is generated by genstdc.py.
* Do not edit by hand.
* Also, this file is automatically updated
* by make when the project is built.
*/
V load_std(V global)
{
char std[] = {''')
with open('std.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(std, sizeof std, a_to_string("(standard library)"), global);
}
''')