Skip to content

Commit

Permalink
Fix incorrect example
Browse files Browse the repository at this point in the history
The `&requires` in the example did not match the actual widths.
  • Loading branch information
bbannier committed Jun 11, 2024
1 parent 26f29c8 commit 99581e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parser_structure_conditional_parsing.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ met](https://docs.zeek.org/projects/spicy/en/latest/programming/parsing.html#con

```spicy
type Integer = unit {
width: uint8 &requires=($$ != 0 && $$ < 8);
width: uint8 &requires=($$ != 0 && $$ < 4);
u8 : uint8 if (self.width == 1);
u16: uint16 if (self.width == 2);
u32: uint32 if (self.width == 3);
Expand All @@ -22,7 +22,7 @@ statement](https://docs.zeek.org/projects/spicy/en/latest/programming/parsing.ht

```spicy
type Integer = unit {
width: uint8 &requires=($$ != 0 && $$ < 8);
width: uint8 &requires=($$ != 0 && $$ < 4);
switch (self.width) {
1 -> u8: uint8;
2 -> u16: uint16;
Expand Down

0 comments on commit 99581e0

Please sign in to comment.