Skip to content

Commit 000a1df

Browse files
committed
generated docs: add array type support
See #3404
1 parent 6d54e8f commit 000a1df

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

lib/std/special/docs/main.js

+10
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,16 @@
395395

396396
function typeName(typeObj, wantHtml, wantSubLink, fnDecl, skipFnName) {
397397
switch (typeObj.kind) {
398+
case typeKinds.Array:
399+
var name = "[";
400+
if (wantHtml) {
401+
name += '<span class="tok-number">' + typeObj.len + '</span>';
402+
} else {
403+
name += typeObj.len;
404+
}
405+
name += "]";
406+
name += typeIndexName(typeObj.elem, wantHtml, wantSubLink, null);
407+
return name;
398408
case typeKinds.Pointer:
399409
var name = "";
400410
switch (typeObj.len) {

src/dump_analysis.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,14 @@ static void anal_dump_type(AnalDumpCtx *ctx, ZigType *ty) {
918918

919919
break;
920920
}
921+
case ZigTypeIdArray: {
922+
jw_object_field(jw, "len");
923+
jw_int(jw, ty->data.array.len);
924+
925+
jw_object_field(jw, "elem");
926+
anal_dump_type_ref(ctx, ty->data.array.child_type);
927+
break;
928+
}
921929
default:
922930
jw_object_field(jw, "name");
923931
jw_string(jw, buf_ptr(&ty->name));

0 commit comments

Comments
 (0)