Skip to content

Commit

Permalink
Document "copy" enums as value types
Browse files Browse the repository at this point in the history
This ensures that enums defined using `type copy enum` are shown as
"value" types in the generated documentation.
  • Loading branch information
yorickpeterse committed Jan 1, 2025
1 parent 3d2d34b commit 10358df
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions compiler/src/docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ fn location_to_json(location: Location) -> Json {
Json::Object(obj)
}

fn type_kind(kind: TypeKind, stack: bool) -> i64 {
fn type_kind(kind: TypeKind, copy: bool) -> i64 {
if copy {
return 4;
}

match kind {
TypeKind::Enum => 1,
TypeKind::Async => 2,
TypeKind::Extern => 3,
TypeKind::Atomic => 5,
_ if stack => 4,
_ => 0,
}
}
Expand Down

0 comments on commit 10358df

Please sign in to comment.