Erlang file syntax error issue

Is there a way to format this so that it is a valid expression without adding another step?

<<One:8,_:(One*8)>> = <<1,9>>. * 1: illegal bit size 

These works

 >> <<One:8,_:8>> = <<1,9>>. <<1,9>> >> One*8. 8 >> <<One:8,_:(1*8)>> = <<1,9>>. <<1,9>> >> <<Eight:8,_:Eight>> = <<8,9>>. <<8,9>> 

I am trying to parse a binary file with embedded data using binary lists instead of storing batteries.

+4
source share
1 answer

Try it: -)

 <<Size:8,_:Size/unit:8>> = <<1,9>>. 
+8
source

Source: https://habr.com/ru/post/1304600/


All Articles