[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Questions about opcodes used in LPEG's vm implementation
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 16 Sep 2013 09:24:01 -0300
> On an unrelated sidenote, I noticed LPeg defining `BITSPERCHAR` to 8
> in one of the headers instead of using `CHAR_BITS` from the standard
> which I found a bit unusual.
The definitions of 'setchar' and 'testchar' only work for 8-bit chars,
and their method only work for char sizes that are power of two. Note
that ANSI says that CHAR_BITS must be at least 8, so the whole stuff
should work on any machine (wasting the extra bits).