Skip to content

Commit f929b42

Browse files
authored
Fix doc build errors. (#5018)
1 parent 5f1ba7b commit f929b42

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

docs/user-guide/02-conventional-features.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ Auto-Generated Constructors
801801
Slang has the following rules:
802802
1. Auto-generate a `__init()` if not already defined
803803
> Assume
804-
```c#
804+
```csharp
805805
struct DontGenerateCtor
806806
{
807807
int a;
@@ -832,7 +832,7 @@ struct GenerateCtor
832832
```
833833

834834
2. If all members have equal visibility, auto-generate a 'member-wise constructor' if not conflicting with a user defined constructor.
835-
```c#
835+
```csharp
836836
struct GenerateCtorInner
837837
{
838838
int a;
@@ -870,7 +870,7 @@ struct GenerateCtor : GenerateCtorInner
870870
* Do not generate if `private` member lacks an init expression
871871
3. `private` 'member-wise constructor'
872872
* Contains members of visibility: `private`, `internal`, `public`
873-
```C#
873+
```csharp
874874
struct GenerateCtorInner1
875875
{
876876
internal int a = 0;
@@ -941,7 +941,7 @@ Initializer Lists
941941
----------
942942
Initializer List's are an expression of the form `{...}`.
943943

944-
```c#
944+
```csharp
945945
int myFunc()
946946
{
947947
int a = {}; // Initializer List
@@ -950,14 +950,14 @@ int myFunc()
950950

951951
### Initializer List's - Scalar
952952

953-
```c#
953+
```csharp
954954
// Equivalent to `int a = 1`
955955
int a = {1};
956956
```
957957

958958
### Initializer List's - Vectors
959959

960-
```c#
960+
```csharp
961961
// Equivalent to `float3 a = float3(1,2,3)`
962962
float3 a = {1, 2, 3};
963963
```
@@ -966,28 +966,28 @@ float3 a = {1, 2, 3};
966966

967967
#### Array Of Scalar's
968968

969-
```c#
969+
```csharp
970970
// Equivalent to `int[2] a; a[0] = 1; a[1] = 2;`
971971
int a[2] = {1, 2}
972972
```
973973

974974
#### Array Of Aggregate's
975975

976-
```c#
976+
```csharp
977977
// Equivlent to `float3 a[2]; a[0] = {1,2,3}; b[1] = {4,5,6};`
978-
float3 a[2] = {{1,2,3}, {4,5,6}};
978+
float3 a[2] = { {1,2,3}, {4,5,6} };
979979
```
980980
#### Flattened Array Initializer
981981

982-
```c#
983-
// Equivalent to `float3 a[2] = {{1,2,3}, {4,5,6}};`
982+
```csharp
983+
// Equivalent to `float3 a[2] = { {1,2,3}, {4,5,6} };`
984984
float3 a[3] = {1,2,3, 4,5,6};
985985
```
986986

987987
### Initializer Lists - Struct
988988

989989
In most scenarios, using an initializer list to create a struct typed value is equivalent to calling the struct's constructor using the elements in the initilaizer list as arguments for the constructor, for example:
990-
```c#
990+
```csharp
991991
struct GenerateCtorInner1
992992
{
993993
internal int a = 0;
@@ -1045,7 +1045,7 @@ struct GenerateCtor1 : GenerateCtorInner1
10451045
...
10461046

10471047
// Calls `{ GenerateCtor1::__init(3), GenerateCtor1::__init(2) }`
1048-
GenerateCtor1 val[2] = {{ 3 }, { 2 }};
1048+
GenerateCtor1 val[2] = { { 3 }, { 2 } };
10491049
```
10501050

10511051
In addition, Slang also provides compatbility support for C-style initializer lists with `struct`s. C-style initializer lists can use [Partial Initializer List's](#Partial-Initializer-List's) and [Flattened Array Initializer With Struct's](#Flattened-Array-Initializer-With-Struct)
@@ -1056,7 +1056,7 @@ A struct is considered a C-style struct if:
10561056

10571057
#### Partial Initializer List's
10581058

1059-
```c#
1059+
```csharp
10601060
struct Foo
10611061
{
10621062
int a;
@@ -1075,7 +1075,7 @@ Foo val = {2, 3};
10751075

10761076
#### Flattened Array Initializer With Struct's
10771077

1078-
```c#
1078+
```csharp
10791079
struct Foo
10801080
{
10811081
int a;
@@ -1085,7 +1085,7 @@ struct Foo
10851085

10861086
...
10871087

1088-
// Equivalent to `Foo val[2] = {{0,1,2}, {3,4,5}};`
1088+
// Equivalent to `Foo val[2] = { {0,1,2}, {3,4,5} };`
10891089
Foo val[2] = {0,1,2, 3,4,5};
10901090
```
10911091

@@ -1097,7 +1097,7 @@ Foo val[2] = {0,1,2, 3,4,5};
10971097
#### Non-Struct Type
10981098

10991099
Value will zero-initialize
1100-
```c#
1100+
```csharp
11011101
// Equivalent to `int val1 = 0;`
11021102
int val1 = {};
11031103

@@ -1110,7 +1110,7 @@ float3 val2 = {};
11101110
1. Atempt to call default constructor (`__init()`) of a `struct`
11111111

11121112

1113-
```c#
1113+
```csharp
11141114
struct Foo
11151115
{
11161116
int a;
@@ -1129,7 +1129,7 @@ Foo val = {};
11291129
```
11301130
2. As a fallback, zero-initialize the struct
11311131

1132-
```c#
1132+
```csharp
11331133
struct Foo
11341134
{
11351135
int a;

0 commit comments

Comments
 (0)