Skip to content

Commit

Permalink
Don't use type: strz with terminator: (...)
Browse files Browse the repository at this point in the history
See kaitai-io/ksy_schema#6 (comment) for a rationale.

In fact, there is a JSON Schema constraint in ksy_schema
to explicitly discourage this syntax (https://github.com/kaitai-io/ksy_schema/blob/e3a0398844734bf58789b9b8f08e3bc0c80a3274/ksy_schema.json#L466-L476).
  • Loading branch information
generalmimon committed Mar 21, 2021
1 parent 97d68e9 commit d66edc7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion formats/nav_parent_vs_value_inst.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ meta:

seq:
- id: s1
type: strz
type: str
encoding: UTF-8
terminator: 0x7C
- id: child
Expand Down
6 changes: 3 additions & 3 deletions formats/opaque_external_type_02_child.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ meta:
endian: le
seq:
- id: s1
type: strz
type: str
encoding: UTF-8
terminator: 0x7C
- id: s2
type: strz
type: str
encoding: UTF-8
terminator: 0x7C
consume: false
Expand All @@ -18,7 +18,7 @@ types:
opaque_external_type_02_child_child:
seq:
- id: s3
type: strz
type: str
encoding: UTF-8
terminator: 0x40
include: true
Expand Down
6 changes: 3 additions & 3 deletions formats/term_strz.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ meta:
endian: le
seq:
- id: s1
type: strz
type: str
encoding: UTF-8
terminator: 0x7c
- id: s2
type: strz
type: str
encoding: UTF-8
terminator: 0x7c
consume: false
- id: s3
type: strz
type: str
encoding: UTF-8
terminator: 0x40
include: true
2 changes: 1 addition & 1 deletion formats/to_string_custom.ksy
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ seq:
type: str
terminator: 0x7c
- id: s2
type: strz
type: str
terminator: 0x7c
to-string: |
"s1 = " + s1 + ", s2 = " + s2

0 comments on commit d66edc7

Please sign in to comment.