mirror of
https://github.com/janet-lang/janet
synced 2025-10-25 20:57:40 +00:00
Use one tag type true and false
We moved the literals true and false into one tag type, so we an extra tag for raw pointer types (light userdata). These can be used from the C API via janet_wrap_pointer and janet_unwrap_pointer.
This commit is contained in:
@@ -179,11 +179,9 @@ void janet_description_b(JanetBuffer *buffer, Janet x) {
|
||||
case JANET_NIL:
|
||||
janet_buffer_push_cstring(buffer, "nil");
|
||||
return;
|
||||
case JANET_TRUE:
|
||||
janet_buffer_push_cstring(buffer, "true");
|
||||
return;
|
||||
case JANET_FALSE:
|
||||
janet_buffer_push_cstring(buffer, "false");
|
||||
case JANET_BOOLEAN:
|
||||
janet_buffer_push_cstring(buffer,
|
||||
janet_unwrap_boolean(x) ? "true" : "false");
|
||||
return;
|
||||
case JANET_NUMBER:
|
||||
number_to_string_b(buffer, janet_unwrap_number(x));
|
||||
@@ -315,8 +313,7 @@ static void janet_pretty_one(struct pretty *S, Janet x, int is_dict_value) {
|
||||
case JANET_NIL:
|
||||
case JANET_NUMBER:
|
||||
case JANET_SYMBOL:
|
||||
case JANET_TRUE:
|
||||
case JANET_FALSE:
|
||||
case JANET_BOOLEAN:
|
||||
break;
|
||||
default: {
|
||||
Janet seenid = janet_table_get(&S->seen, x);
|
||||
|
||||
Reference in New Issue
Block a user