diff --git a/doc/langref.html.in b/doc/langref.html.in index 20b8ae1eee..76bf0ce237 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -136,7 +136,7 @@
  • @divFloor
  • @divTrunc
  • @embedFile
  • -
  • @enumTagName
  • +
  • @tagName
  • @EnumTagType
  • @errorName
  • @fence
  • @@ -2165,7 +2165,7 @@ test "enum variant switch" { }; } -// The @enumTagName and @memberCount builtin functions can be used to +// The @memberName and @memberCount builtin functions can be used to // the string representation and number of members respectively. const BuiltinType = enum { A: f32, @@ -2174,8 +2174,8 @@ const BuiltinType = enum { }; test "enum builtins" { - assert(mem.eql(u8, @enumTagName(BuiltinType.A { 0 }), "A")); - assert(mem.eql(u8, @enumTagName(BuiltinType.C), "C")); + assert(mem.eql(u8, @memberName(BuiltinType.A { 0 }), "A")); + assert(mem.eql(u8, @memberName(BuiltinType.C), "C")); assert(@memberCount(BuiltinType) == 3); }
    $ zig test enum.zig
    @@ -2189,8 +2189,9 @@ Test 4/4 enum builtins...OK

    See also:

    union

    TODO union documentation

    @@ -4252,10 +4253,10 @@ test.zig:6:2: error: found compile log statement -

    @enumTagName

    -
    @enumTagName(value: var) -> []const u8
    +

    @tagName

    +
    @tagName(value: var) -> []const u8

    - Converts an enum tag name to a slice of bytes. + Converts an enum value or union value to a slice of bytes representing the name.

    @EnumTagType

    @EnumTagType(T: type) -> type
    @@ -5843,7 +5844,9 @@ GroupedExpression = "(" Expression ")" KeywordLiteral = "true" | "false" | "null" | "continue" | "undefined" | "error" | "this" | "unreachable" -ContainerDecl = option("extern" | "packed") ("struct" | "union" | ("enum" option(GroupedExpression))) "{" many(ContainerMember) "}" +ContainerDecl = option("extern" | "packed") + ("struct" option(GroupedExpression) | "union" option("enum" option(GroupedExpression) | GroupedExpression) | ("enum" option(GroupedExpression))) + "{" many(ContainerMember) "}"

    Zen