Skip to content

Commit cc3de84

Browse files
authored
docs: Fix typo in Arrays and better document 1D arrays only (#1939)
Signed-off-by: Sparsh-N <[email protected]>
1 parent d0d4a06 commit cc3de84

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/doc/datatypes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,8 @@ are 1D and statically sized, using the usual syntax for C-like languages:
558558
float c[3] = { 0.1, 0.2, 3.14 }; // Initialize the array
559559
560560
float f = c[1]; // Access one element
561+
562+
float d[10][3]; // Invalid, multi-dimensional arrays not supported
561563
```
562564

563565
The built-in function `arraylength()` returns the number of elements in an

src/doc/syntax.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ Some examples of variable declarations are
8888

8989
Arrays are also supported, declared as follows:
9090

91-
> *type variablename* `[` *arraylen* `}`
91+
> *type variablename* `[` *arraylen* `]`
9292
>
93-
> *type variablename* `[` *arraylen* `}` `=` `{` *init0 `,` *init1* ... `}`
93+
> *type variablename* `[` *arraylen* `]` `=` `{` *init0 `,` *init1* ... `}`
9494
9595
Array variables in OSL must have a constant length (though function parameters
9696
and shader parameters may have undetermined length). Some examples of array

0 commit comments

Comments
 (0)