| author | |
| committer | |
| log | bf46117f1314653df3a70ede05aabcd599ce6b08 |
| tree | a60f55188c5f0f8b31da51b1d4b8c2a8223198c1 |
| parent | ed23dad4877cd93fd684852b17e0e554ef71e297 |
2 files changed, 24 insertions(+), 0 deletions(-)
lib/std/special/docs/main.js+12| ... | ... | @@ -542,8 +542,20 @@ |
| 542 | 542 | } else { |
| 543 | 543 | return value + ""; |
| 544 | 544 | } |
| 545 | case typeKinds.Optional: | |
| 546 | if(value === 'null'){ | |
| 547 | if (wantHtml) { | |
| 548 | return '<span class="tok-null">' + value + '</span>'; | |
| 549 | } else { | |
| 550 | return value + ""; | |
| 551 | } | |
| 552 | } else { | |
| 553 | console.trace("TODO non-null optional value printing"); | |
| 554 | return "TODO"; | |
| 555 | } | |
| 545 | 556 | default: |
| 546 | 557 | console.trace("TODO implement getValueText for this type:", zigAnalysis.typeKinds[typeObj.kind]); |
| 558 | return "TODO"; | |
| 547 | 559 | } |
| 548 | 560 | } |
| 549 | 561 |
src/dump_analysis.cpp+12| ... | ... | @@ -693,6 +693,18 @@ static void anal_dump_value(AnalDumpCtx *ctx, AstNode *source_node, ZigType *ty, |
| 693 | 693 | } |
| 694 | 694 | return; |
| 695 | 695 | } |
| 696 | case ZigTypeIdOptional: { | |
| 697 | if(optional_value_is_null(value)){ | |
| 698 | jw_string(&ctx->jw, "null"); | |
| 699 | } else { | |
| 700 | jw_null(&ctx->jw); | |
| 701 | } | |
| 702 | return; | |
| 703 | } | |
| 704 | case ZigTypeIdInt: { | |
| 705 | jw_bigint(&ctx->jw, &value->data.x_bigint); | |
| 706 | return; | |
| 707 | } | |
| 696 | 708 | default: |
| 697 | 709 | jw_null(&ctx->jw); |
| 698 | 710 | return; |