Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions tools/sddl/compiler/Syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,23 @@ Consuming an **Array** consumes the inner field a number of times, equal to the

##### Records

A **Record** is a sequential collection of **Fields**. A Record is declared by listing its member fields as a comma-separated list between curly braces:
A **Record** is a sequential collection of **Fields**. A Record is declared by listing its member fields between curly braces, one per line (newline- or semicolon-separated, like any other statements):

```
Row = {
Byte,
Byte,
UInt32LE[8],
Byte
Byte
UInt32LE[8]
}
```

A member field of type `T` in a record can be expressed in the following three ways:

```
{
T, # Bare field, implies the consumption of the field
: T, # An instruction to consume the field, equivalent to the previous
var : T, # Consumption of the field, with the result assigned to a variable
T # Bare field, implies the consumption of the field
: T # An instruction to consume the field, equivalent to the previous
var : T # Consumption of the field, with the result assigned to a variable
}
```

Expand All @@ -112,8 +112,8 @@ The return value of consuming a Record is a scope object, which contains variabl
!!! example
```
Header = {
magic : UInt32LE,
size : UInt32LE,
magic : UInt32LE
size : UInt32LE
}

hdr : Header
Expand Down
Loading