PMunch / binaryparse

Binary parser for Nim
MIT License
71 stars 6 forks source link

Internal error when specifying a count #3

Closed f-carraro closed 5 years ago

f-carraro commented 5 years ago

Hello, I'm trying a simple exmple with the following code:

import streams, binaryparse

var strm = newFileStream("demodado.tem",fmRead)

createParser(simple):
  u16: field1[2]

echo simple.get(strm)

When introducing any count on field1 the following error occurs:

\binaryparse-0.2.2\binaryparse.nim(476, 22) Error: internal error: environment misses: :tmp

Omitting the "[2]" the compilation runs fine.

PMunch commented 5 years ago

This appears to be a Nim issue: https://github.com/nim-lang/Nim/issues/10456. Compiling with 0.19.0 works fine.

f-carraro commented 5 years ago

Tested with 0.19.4 and it indeed works fine. Thanks.