diff --git a/Makefile b/Makefile index 73de4d5..2e718bc 100644 --- a/Makefile +++ b/Makefile @@ -6,5 +6,6 @@ build-debug: build-lib: @echo "Building lib..." + rm -rf /usr/include/hazure/ cp ./lib/. /usr/include/hazure/ -r @echo "Building lib... done" \ No newline at end of file diff --git a/README.md b/README.md index e0a842a..8d4f477 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,12 @@ Note: Everything in this project can be changed at anytime! (I'm still finding o Lowerer(?) produce HIR │ crates/hir │ + Type Checker (TODO) + │ │ + │ ╰ Fail -> Print error -> Exit + Pass + │ + │ Diagnostic(Lowering) │ │ crates/diagnostic │ ╰ Fail -> Print error -> Exit diff --git a/crates/codegen/src/cpp.rs b/crates/codegen/src/cpp.rs index ec8529f..8e7862f 100644 --- a/crates/codegen/src/cpp.rs +++ b/crates/codegen/src/cpp.rs @@ -65,8 +65,10 @@ impl Codegen { match name.as_str() { "write" => { format!("hazure_write({}){}\n", self.gen_ir(&args[0], false), semicolon!()) }, "read" => { format!("hazure_read(){}\n", semicolon!()) }, + "write_file" => { format!("hazure_write({}){}\n", self.gen_ir(&args[0], false), semicolon!()) }, "read_file" => { format!("hazure_read_file({}){}\n", self.gen_ir(&args[0], false), semicolon!()) }, + "time" => { format!("hazure_get_time(){}\n", semicolon!()) }, _ => unreachable!(format!("Unknown intrinsic: {}", name)) // Shoul be handled by lowering } diff --git a/lib/io.hpp b/lib/io.hpp index d6b9b85..b8780de 100644 --- a/lib/io.hpp +++ b/lib/io.hpp @@ -5,7 +5,7 @@ template /** - * @brief Read the value from stdin and return it. + * Read the value from stdin and return it. */ T hazure_read() { T x; @@ -15,8 +15,8 @@ T hazure_read() { template /** - * @brief Prints the value of the variable to the stdout. - * + * Prints the value of the variable to the stdout. + * * @param value The value to print. */ void hazure_write(T x) { @@ -24,7 +24,7 @@ void hazure_write(T x) { } /* - * @brief Read the value from the file and return it. + * Read the value from the file and return it. * * @param file_name The name of the file to read from. * @return std::string The value read from the file. @@ -37,7 +37,7 @@ std::string hazure_read_file(std::string filename) { } /* - * @brief Write string to file. + * Write string to file. * * @param filename The file name to write to. * @param content The content to write.