Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@wbarnha
Copy link

@wbarnha wbarnha commented Apr 24, 2023

I'm in the process of exporting Structs to Kaitai schemas, and the Optional field is something I use very often.

I figure that since Optional is typically parsed only when data is available, then using not(_.io.eof) could be used to achieve similar functionality. Or is there something else I'm missing here?

wbarnha added 3 commits April 24, 2023 12:41
I'm in the process of exporting Structs to Kaitai schemas, and the `Optional` field is something I use very often. 

I figure that since `Optional` is typically parsed only when data is available, then using `not _.io.eof` could be used to achieve similar functionality. Or is there something else I'm missing here?
@wbarnha wbarnha changed the title Add emitfulltype to Optional Add _emitfulltype to Optional and _emitprimitivetype to Peek Apr 24, 2023
@franzhaas
Copy link

Correct me when i am wrong, but i do believe the Optional is not limited to EOF situations.

However, it is a common purpose, and different to the more general current Optional, it is translateable to kaitai.

Maybe we should add an option, or make a OnlyIfDataExists alternative?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.