@@ -443,7 +443,12 @@ mirb_highlight_print_line(mirb_highlighter *hl, const char *line)
|
443 | 443 | |
444 | 444 | size_t len = (size_t)(p - token_start); |
445 | 445 | |
446 | | -if (is_const) { |
| 446 | +/* Check for hash key symbol syntax: identifier followed by ': ' */ |
| 447 | +if (*p == ':' && (p[1] == ' ' || p[1] == '\0' || p[1] == ',' || p[1] == '}')) { |
| 448 | +p++; /* include the colon */ |
| 449 | +print_colored(hl, token_start, (size_t)(p - token_start), MIRB_TOK_SYMBOL); |
| 450 | + } |
| 451 | +else if (is_const) { |
447 | 452 | print_colored(hl, token_start, len, MIRB_TOK_CONSTANT); |
448 | 453 | } |
449 | 454 | else if (!after_dot && is_keyword(token_start, len)) { |
@@ -476,16 +481,16 @@ mirb_highlight_print_result(mirb_highlighter *hl, const char *result)
|
476 | 481 | return; |
477 | 482 | } |
478 | 483 | |
| 484 | +/* Print arrow in gray */ |
479 | 485 | if (hl->theme == MIRB_THEME_DARK) { |
480 | 486 | fputs(DARK_ARROW " => " COLOR_RESET, stdout); |
481 | | -fputs(DARK_RESULT, stdout); |
482 | 487 | } |
483 | 488 | else { |
484 | 489 | fputs(LIGHT_ARROW " => " COLOR_RESET, stdout); |
485 | | -fputs(LIGHT_RESULT, stdout); |
486 | 490 | } |
487 | | -fputs(result, stdout); |
488 | | -fputs(COLOR_RESET "\n", stdout); |
| 491 | +/* Syntax highlight the result value */ |
| 492 | +mirb_highlight_print_line(hl, result); |
| 493 | +putchar('\n'); |
489 | 494 | } |
490 | 495 | |
491 | 496 | /* |
|