authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2020-05-02 23:28:44+02:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2020-05-02 23:28:44+02:00
log3a397795be1c0219a3a0d96082ee7d4eeddbfa7a
treeca153cf8828778b4ec8782b7d2ea3fa83af6c0b1
parent03a7124543a52f7904090516e572b71b893c7ba2
signaturelock-open Commit is signed but in an unrecognized format.

Apply naming conventions of structs to files


1 files changed, 8 insertions(+), 0 deletions(-)

doc/langref.html.in+8
...@@ -9990,6 +9990,13 @@ coding style....@@ -9990,6 +9990,13 @@ coding style.
9990 conventions.9990 conventions.
9991 </p>9991 </p>
9992 <p>9992 <p>
9993 File names fall into two categories: types and namespaces. If the file
9994 (implicity a struct) has top level fields, it should be named like any
9995 other struct with fields using {#syntax#}TitleCase{#endsyntax#}. Otherwise,
9996 it should use {#syntax#}snake_case{#endsyntax#}. Directory names should be
9997 {#syntax#}snake_case{#endsyntax#}.
9998 </p>
9999 <p>
9993 These are general rules of thumb; if it makes sense to do something different,10000 These are general rules of thumb; if it makes sense to do something different,
9994 do what makes sense. For example, if there is an established convention such as10001 do what makes sense. For example, if there is an established convention such as
9995 {#syntax#}ENOENT{#endsyntax#}, follow the established convention.10002 {#syntax#}ENOENT{#endsyntax#}, follow the established convention.
...@@ -9998,6 +10005,7 @@ coding style....@@ -9998,6 +10005,7 @@ coding style.
9998 {#header_open|Examples#}10005 {#header_open|Examples#}
9999 {#code_begin|syntax#}10006 {#code_begin|syntax#}
10000const namespace_name = @import("dir_name/file_name.zig");10007const namespace_name = @import("dir_name/file_name.zig");
10008const TypeName = @import("dir_name/TypeName.zig");
10001var global_var: i32 = undefined;10009var global_var: i32 = undefined;
10002const const_name = 42;10010const const_name = 42;
10003const primitive_type_alias = f32;10011const primitive_type_alias = f32;