From 72bf9d90cc5fa4384ca7db1e5bbd4b9445e63bd3 Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Thu, 19 Apr 2018 21:48:09 +0200 Subject: [PATCH] Added builtin field to docs --- doc/langref.html.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index 034b8c1629..16fafdaad9 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -4412,6 +4412,10 @@ fn add(a: i32, b: i32) i32 { return a + b; } It does not include functions, variables, or constants.

{#header_close#} + {#header_open|@field#} +
@field(lhs: var, comptime field_name: []const u8) -> (field)
+

Preforms field access equivalent to lhs.->field_name-<.

+ {#header_close#} {#header_open|@memberType#}
@memberType(comptime T: type, comptime index: usize) -> type

Returns the field type of a struct or union.

@@ -6064,7 +6068,7 @@ hljs.registerLanguage("zig", function(t) { a = t.IR + "\\s*\\(", c = { keyword: "const align var extern stdcallcc nakedcc volatile export pub noalias inline struct packed enum union break return try catch test continue unreachable comptime and or asm defer errdefer if else switch while for fn use bool f32 f64 void type noreturn error i8 u8 i16 u16 i32 u32 i64 u64 isize usize i8w u8w i16w i32w u32w i64w u64w isizew usizew c_short c_ushort c_int c_uint c_long c_ulong c_longlong c_ulonglong", - built_in: "atomicLoad breakpoint returnAddress frameAddress fieldParentPtr setFloatMode IntType OpaqueType compileError compileLog setCold setRuntimeSafety setEvalBranchQuota offsetOf memcpy inlineCall setGlobalLinkage setGlobalSection divTrunc divFloor enumTagName intToPtr ptrToInt panic canImplicitCast ptrCast bitCast rem mod memset sizeOf alignOf alignCast maxValue minValue memberCount memberName memberType typeOf addWithOverflow subWithOverflow mulWithOverflow shlWithOverflow shlExact shrExact cInclude cDefine cUndef ctz clz import cImport errorName embedFile cmpxchgStrong cmpxchgWeak fence divExact truncate atomicRmw sqrt", + built_in: "atomicLoad breakpoint returnAddress frameAddress fieldParentPtr setFloatMode IntType OpaqueType compileError compileLog setCold setRuntimeSafety setEvalBranchQuota offsetOf memcpy inlineCall setGlobalLinkage setGlobalSection divTrunc divFloor enumTagName intToPtr ptrToInt panic canImplicitCast ptrCast bitCast rem mod memset sizeOf alignOf alignCast maxValue minValue memberCount memberName memberType typeOf addWithOverflow subWithOverflow mulWithOverflow shlWithOverflow shlExact shrExact cInclude cDefine cUndef ctz clz import cImport errorName embedFile cmpxchgStrong cmpxchgWeak fence divExact truncate atomicRmw sqrt field", literal: "true false null undefined" }, n = [e, t.CLCM, t.CBCM, s, r];