-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FStar.Char: move type into smaller FStar.Char.Type module #3408
base: master
Are you sure you want to change the base?
Conversation
Char type moved, one less warning too due to less dependencies.
This requires the following krml patch: diff --git a/include/krml/internal/types.h b/include/krml/internal/types.h
index e41b39be..71e8733f 100644
--- a/include/krml/internal/types.h
+++ b/include/krml/internal/types.h
@@ -28,7 +28,7 @@ typedef uint64_t FStar_UInt63_t, FStar_UInt63_t_;
typedef int64_t FStar_Int63_t, FStar_Int63_t_;
typedef double FStar_Float_float;
-typedef uint32_t FStar_Char_char;
+typedef uint32_t FStar_Char_Type_char;
typedef FILE *FStar_IO_fd_read, *FStar_IO_fd_write;
typedef void *FStar_Dyn_dyn;
diff --git a/krmllib/c/fstar_char.c b/krmllib/c/fstar_char.c
index f6931522..669220cc 100644
--- a/krmllib/c/fstar_char.c
+++ b/krmllib/c/fstar_char.c
@@ -3,6 +3,6 @@
#include "FStar_Char.h"
-FStar_Char_char FStar_Char_char_of_u32(uint32_t x) {
+FStar_Char_Type_char FStar_Char_Type_char_of_u32(uint32_t x) {
return x;
}
diff --git a/krmllib/c/fstar_string.c b/krmllib/c/fstar_string.c
index 1117bfa2..7e920134 100644
--- a/krmllib/c/fstar_string.c
+++ b/krmllib/c/fstar_string.c
@@ -28,7 +28,7 @@ Prims_string FStar_String_strcat(Prims_string s0, Prims_string s1) {
}
-krml_checked_int_t FStar_String_index_of(Prims_string s1, FStar_Char_char fc) {
+krml_checked_int_t FStar_String_index_of(Prims_string s1, FStar_Char_Type_char fc) {
if (fc > 127) {
KRML_HOST_PRINTF("FStar.Char.char overflow at %s:%d\n", __FILE__, __LINE__);
KRML_HOST_EXIT(252);
diff --git a/krmllib/c/lowstar_printf.c b/krmllib/c/lowstar_printf.c
index 409dfbf1..91a8a4ab 100644
--- a/krmllib/c/lowstar_printf.c
+++ b/krmllib/c/lowstar_printf.c
@@ -17,7 +17,7 @@
PRINTB(N, T, M2)
PRINT2 (string, Prims_string, "s", "s")
-PRINT2 (char, FStar_Char_char, PRIu32, PRIx32)
+PRINT2 (char, FStar_Char_Type_char, PRIu32, PRIx32)
PRINT2 (u8, uint8_t, PRIu8, PRIx8)
PRINT2 (u16, uint16_t, PRIu16, PRIx16)
PRINT2 (u32, uint32_t, PRIu32, PRIx32) |
FWIW, we could eliminate the Classical.Sugar dependency by adding an interface to |
Good point! I did this for |
I'm not sure if it's worth it to automate the interface-generation step, but I think a reasonable policy would be that interfaces shouldn't depend on "proof modules":
|
This reduces the dependencies that clients take on just for mentioning the char type or a character literal. Currently this brings in a lot to just check a module with
let x = 'a'
:With this PR: