1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-19 17:57:40 +00:00

Add vars, split up headers, remove fiber->ret, add comparators, etc.

This commit is contained in:
bakpakin
2017-12-30 16:46:59 -05:00
parent 34a83839f5
commit f273aa8b1b
26 changed files with 2144 additions and 2261 deletions

View File

@@ -363,23 +363,41 @@ static int is_print_ds(DstValue v) {
/* VT100 Colors for types */
/* TODO - generalize into configurable headers and footers */
/*
DST_NIL,
DST_FALSE,
DST_TRUE,
DST_FIBER,
DST_INTEGER,
DST_REAL,
DST_STRING,
DST_SYMBOL,
DST_ARRAY,
DST_TUPLE,
DST_TABLE,
DST_STRUCT,
DST_BUFFER,
DST_FUNCTION,
DST_CFUNCTION,
DST_USERDATA
*/
static const char *dst_type_colors[16] = {
"\x1B[35m",
"\x1B[33m",
"\x1B[33m",
"\x1B[35m",
"\x1B[35m",
"\x1B[32m",
"",
"\x1B[33m",
"\x1B[33m",
"\x1B[36m",
"",
"",
"",
"",
"\x1B[37m",
"\x1B[37m",
"\x1B[37m",
"\x1B[37m",
"\x1B[37m"
"",
"",
"",
"",
""
};
/* Forward declaration */
@@ -629,6 +647,13 @@ const uint8_t *dst_formatc(const char *format, ...) {
dst_description_helper(&printer, va_arg(args, DstValue));
break;
}
case 'C':
{
dst_printer_defaults(&printer);
printer.flags |= DST_PRINTFLAG_COLORIZE;
dst_description_helper(&printer, va_arg(args, DstValue));
break;
}
case 'q':
{
const uint8_t *str = va_arg(args, const uint8_t *);