You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was looking through the code and noticed this project does not (yet) support parsing of binary protocols - is that something you want to add support for later? 馃檱
I added a new node type called Byte, that works like a mix between Invoke and Match - it matches any byte and then passes it on to a given code function.
I've yet to figure the best way out to expose reading of values coming in in little endian order. 馃
Anyway, is this how you'd implement binary reading in llparse? Or do you have any other ideas how this could be exposed in a nicer / more consistent fashion?
Sorry if I am choosing to reopen a dead issue but I am making a PR that attempts the same thing but is a lot simpler and has active tools to help prevent errors from occurring nodejs/llparse-builder#197
Activity
indutny commentedon Nov 28, 2019
Maybe...?
arthurschreiber commentedon Dec 2, 2019
So I played around with this a bit more.
I added a new node type called
Byte, that works like a mix betweenInvokeandMatch- it matches any byte and then passes it on to a given code function.It works something like this:
I've yet to figure the best way out to expose reading of values coming in in little endian order. 馃
Anyway, is this how you'd implement binary reading in llparse? Or do you have any other ideas how this could be exposed in a nicer / more consistent fashion?
arthurschreiber commentedon Dec 2, 2019
Maybe it would be better to just add two new nodes for reading signed/unsigned LE and BE encoded bytes into a field:
This could automatically check that the field is large enough to read the required number of bytes into it.
This would already cover most of my needs, and should be pretty straightforward to implement, I think. @indutny What do you think?
Vizonex commentedon May 28, 2026
Sorry if I am choosing to reopen a dead issue but I am making a PR that attempts the same thing but is a lot simpler and has active tools to help prevent errors from occurring nodejs/llparse-builder#197