Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix section links in reference docs. #188

Merged
Merged
Show file tree
Hide file tree
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
16 changes: 8 additions & 8 deletions doc/cpp-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static constexpr auto IntrinsicSizeInBytes() const;
```

The `IntrinsicSizeInBytes` method is the [field method](#struct-field-methods)
for [`$size_in_bytes`](language-reference.md#size-in-bytes). The `Read` method
for [`$size_in_bytes`](language-reference.md#size_in_bytes). The `Read` method
of the result returns the size of the `struct`, and the `Ok` method returns
`true` if the `struct`'s intrinsic size is known; i.e.:

Expand Down Expand Up @@ -212,7 +212,7 @@ static constexpr auto MaxSizeInBytes() const;
```

The `MaxSizeInBytes` method is the [field method](#struct-field-methods)
for [`$max_size_in_bytes`](language-reference.md#max-size-in-bytes). The `Read`
for [`$max_size_in_bytes`](language-reference.md#max_size_in_bytes). The `Read`
method of the result returns the maximum size of the `struct`, and the `Ok`
always method returns `true`.

Expand Down Expand Up @@ -250,7 +250,7 @@ static constexpr auto MinSizeInBytes() const;
```

The `MinSizeInBytes` method is the [field method](#struct-field-methods)
for [`$min_size_in_bytes`](language-reference.md#max-size-in-bytes). The `Read`
for [`$min_size_in_bytes`](language-reference.md#min_size_in_bytes). The `Read`
method of the result returns the minimum size of the `struct`, and the `Ok`
always method returns `true`.

Expand Down Expand Up @@ -367,7 +367,7 @@ Returns the backing storage for the view. The return type of `BackingStorage()`
is a template parameter on the view.


### Field methods {#struct-field-methods}
### `struct` field methods

Each physical field and virtual field in the `struct` will have a corresponding
method in the generated view for that `struct`, which returns a subview of that
Expand Down Expand Up @@ -635,7 +635,7 @@ static constexpr auto IntrinsicSizeInBits() const;
```

The `IntrinsicSizeInBits` method is the [field method](#bits-field-methods) for
[`$size_in_bits`](language-reference.md#size-in-bits). The `Read` method of
[`$size_in_bits`](language-reference.md#size_in_bits). The `Read` method of
the result returns the size of the `struct`, and the `Ok` method returns `true`
if the `struct`'s intrinsic size is known; i.e.:

Expand Down Expand Up @@ -666,7 +666,7 @@ static constexpr auto MaxSizeInBits() const;
```

The `MaxSizeInBits` method is the [field method](#struct-field-methods)
for [`$max_size_in_bits`](language-reference.md#max-size-in-bits). The `Read`
for [`$max_size_in_bits`](language-reference.md#max_size_in_bits). The `Read`
method of the result returns the maximum size of the `bits`, and the `Ok`
always method returns `true`.

Expand Down Expand Up @@ -704,7 +704,7 @@ static constexpr auto MinSizeInBits() const;
```

The `MinSizeInBits` method is the [field method](#struct-field-methods)
for [`$min_size_in_bits`](language-reference.md#min-size-in-bits). The `Read`
for [`$min_size_in_bits`](language-reference.md#min_size_in_bits). The `Read`
method of the result returns the minimum size of the `bits`, and the `Ok`
always method returns `true`.

Expand Down Expand Up @@ -773,7 +773,7 @@ form that can be decoded by `UpdateFromTextStream`. Generally, applications
would not call this directly; instead, use the global `WriteToString` method,
which handles setting up the stream and returning the resulting string.

### Field methods {#bits-field-methods}
### `bits` field methods

As with `struct`, each field in a `bits` will have a corresponding method of the
same name generated, and each such method will return a view of the given field.
Expand Down
28 changes: 14 additions & 14 deletions doc/language-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ struct Outer:
```


##### `$size_in_bytes` {#size-in-bytes}
##### `$size_in_bytes`

An Emboss `struct` has an *intrinsic* size, which is the size required to hold
every field in the `struct`, regardless of how many bytes are in the buffer that
Expand Down Expand Up @@ -702,7 +702,7 @@ struct Envelope2:
```


##### `$max_size_in_bytes` {#max-size-in-bytes}
##### `$max_size_in_bytes`

The `$max_size_in_bytes` virtual field is a constant value that is at least as
large as the largest possible value for `$size_in_bytes`. In most cases, it
Expand All @@ -720,7 +720,7 @@ struct PaddedContainer:
```


##### `$min_size_in_bytes` {#min-size-in-bytes}
##### `$min_size_in_bytes`

The `$min_size_in_bytes` virtual field is a constant value that is no larger
than the smallest possible value for `$size_in_bytes`. In most cases, it will
Expand Down Expand Up @@ -1004,7 +1004,7 @@ struct Outer:
```


##### `$size_in_bits` {#size-in-bits}
##### `$size_in_bits`

Like a `struct`, an Emboss `bits` has an *intrinsic* size, which is the size
required to hold every field in the `bits`, regardless of how many bits are
Expand All @@ -1029,14 +1029,14 @@ Unlike `struct`s, the size of `bits` must known at compile time; there are no
dynamic `$size_in_bits` fields.


##### `$max_size_in_bits` {#max-size-in-bits}
##### `$max_size_in_bits`

Since `bits` must be fixed size, the `$max_size_in_bits` field has the same
value as `$size_in_bits`. It is provided for consistency with
`$max_size_in_bytes`.


##### `$min_size_in_bits` {#min-size-in-bits}
##### `$min_size_in_bits`

Since `bits` must be fixed size, the `$min_size_in_bits` field has the same
value as `$size_in_bits`. It is provided for consistency with
Expand Down Expand Up @@ -1178,15 +1178,15 @@ Emboss operators have the following precedence (tightest binding to loosest
binding):

1. `()` `$max()` `$present()` `$upper_bound()` `$lower_bound()`
2. unary `+` and `-` ([see note 1](#precedence-note-unary-plus-minus))
2. unary `+` and `-` ([see note 1](#note-1-unary-plusminus-precedence))
3. `*`
4. `+` `-`
5. `<` `>` `==` `!=` `>=` `<=` ([see note 2](#precedence-note-comparisons))
6. `&&` `||` ([see note 3](#precedence-note-and-or))
7. `?:` ([see note 4](#precedence-note-choice))
5. `<` `>` `==` `!=` `>=` `<=` ([see note 2](#note-2-chained-and-mixed-comparisons))
6. `&&` `||` ([see note 3](#note-3-logical-andor-precedence))
7. `?:` ([see note 4](#note-4-choice-operator-precedence))


###### Note 1 {#precedence-note-unary-plus-minus}
###### Note 1 (Unary Plus/Minus Precedence)

Only one unary `+` or `-` may be applied to an expression without parentheses.
These expressions are valid:
Expand All @@ -1207,7 +1207,7 @@ These are not:
```


###### Note 2 {#precedence-note-comparisons}
###### Note 2 (Chained and Mixed Comparisons)

The relational operators may be chained like so:

Expand Down Expand Up @@ -1240,7 +1240,7 @@ A chain may contain either `<`, `<=`, and/or `==`, or `>`, `>=`, and/or `==`.
Greater-than comparisons may not be mixed with less-than comparisons.


###### Note 3 {#precedence-note-and-or}
###### Note 3 (Logical And/Or Precedence)

The boolean logical operators have the same precedence, but may not be mixed
without parentheses. The following are allowed:
Expand All @@ -1260,7 +1260,7 @@ x && y || z
```


###### Note 4 {#precedence-note-choice}
###### Note 4 (Choice Operator Precedence)

The choice operator `?:` may not be chained without parentheses. These are OK:

Expand Down