Starting to really parse! Fixed the bad syntax trees (reduction copy_construct wasn't actually copying label because param and dest had same name) and fixed the krakenGrammer and CGenerator to allow escaped quotes in regular strings. add_children needs to be finished so the resulting trees don't go nuts with ambiguity, and some situations still cause vector access errors, which is odd. Also added the crazy simple write_file to io and the test_grammer.krak now outputs a syntax_tree.dot
This commit is contained in:
@@ -98,4 +98,17 @@ fun read_file(path: string::string): string::string {
|
||||
}
|
||||
return toRet
|
||||
}
|
||||
fun write_file(path: string::string, data: string::string) {
|
||||
var char_path = path.toCharArray()
|
||||
defer delete(char_path)
|
||||
var char_data = data.toCharArray()
|
||||
defer delete(char_data)
|
||||
__if_comp__ __C__ {
|
||||
simple_passthrough(char_path,char_data::) """
|
||||
FILE *fp = fopen(char_path, "w");
|
||||
fprintf(fp, "%s", char_data);
|
||||
fclose(fp);
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user