Commit bf46117f13
Changed files (2)
lib
std
special
docs
lib/std/special/docs/main.js
@@ -542,8 +542,20 @@
} else {
return value + "";
}
+ case typeKinds.Optional:
+ if(value === 'null'){
+ if (wantHtml) {
+ return '<span class="tok-null">' + value + '</span>';
+ } else {
+ return value + "";
+ }
+ } else {
+ console.trace("TODO non-null optional value printing");
+ return "TODO";
+ }
default:
console.trace("TODO implement getValueText for this type:", zigAnalysis.typeKinds[typeObj.kind]);
+ return "TODO";
}
}
src/dump_analysis.cpp
@@ -693,6 +693,18 @@ static void anal_dump_value(AnalDumpCtx *ctx, AstNode *source_node, ZigType *ty,
}
return;
}
+ case ZigTypeIdOptional: {
+ if(optional_value_is_null(value)){
+ jw_string(&ctx->jw, "null");
+ } else {
+ jw_null(&ctx->jw);
+ }
+ return;
+ }
+ case ZigTypeIdInt: {
+ jw_bigint(&ctx->jw, &value->data.x_bigint);
+ return;
+ }
default:
jw_null(&ctx->jw);
return;