You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

63 lines
1.7 KiB

  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <stdio.h>
  3. #include <string.h>
  4. #include "./types.hpp"
  5. #include "./hooks.hpp"
  6. #include "./error.hpp"
  7. #include "./print.hpp"
  8. int print_dots(FILE* f) {
  9. return print_to_file(f, "...");
  10. }
  11. void test_printer() {
  12. // u32 arr[] = {1,2,3,4,1,1,3};
  13. // f32 f_arr[] = {1.1,2.1,3.2};
  14. // init_printer();
  15. // register_printer("dots", print_dots, Printer_Function_Type::_void);
  16. // u32 u1 = -1;
  17. // u64 u2 = -1;
  18. // char* str;
  19. // print_to_string(&str, " - %{dots[5]} %{->} <> %{->,2}\n", &u1, &arr, nullptr);
  20. // print("---> %{->char}", str);
  21. // print(" - %{dots[3]}\n");
  22. // print(" - %{u32} %{u64}\n", u1, u2);
  23. // print(" - %{u32} %{u32} %{u32}\n", 2, 5, 7);
  24. // print(" - %{f32} %{f32} %{f32}\n", 2.0, 5.0, 7.0);
  25. // print(" - %{u32} %{bool} %{->char}\n", 2, true, "hello");
  26. // print(" - %{f32[3]}\n", f_arr);
  27. // print(" - %{f32,3}\n", 44.9, 55.1, 66.2);
  28. // print(" - %{u32[5]}\n", arr);
  29. // print(" - %{u32[*]}\n", arr, 4);
  30. // print(" - %{u32,5}\n", 1,2,3,4,1,2);
  31. // print(" - %{unknown%d}\n", 1);
  32. // print(" - %{s32,3}\n", -1,200,-300);
  33. // print(" - %{->} <> %{->,2}\n", &u1, &arr, nullptr);
  34. }
  35. s32 main(s32 argc, char* argv[]) {
  36. // test_printer();
  37. init_printer();
  38. create_generic_error("nothing to lex was found:\n"
  39. " in %{color<}%{->char}%{>color}\n"
  40. " at %{color<}%{->char}%{>color}\n"
  41. "bottom text\n",
  42. console_green,
  43. "some file name",
  44. console_cyan,
  45. "yesssssss");
  46. return 0;
  47. }