OK, it turns out that having [^\x00] as a character range gives me the error with pred. [\x00] works fine; [^\x00] gives the error message.<br><br><div class="gmail_quote">On Sat, Mar 24, 2012 at 6:33 PM, Omari Norman <span dir="ltr">&lt;<a href="mailto:omari@smileystation.com">omari@smileystation.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I&#39;m wrinting (or at least, trying to write) an Alex lexer. Say I want to group character ranges together and specify that I want a character that is *not* in any of those ranges. Example<br>
<br>---<br><br><span> </span>{<br>
module Main where<br>}<br><br>%wrapper &quot;posn-bytestring&quot;<br><br>$lowAscii = \x00-\x1f -- unprintable stuff<br>$lowSymbol = \x21-\x2f -- exclamation point to solidus<br>$space = \x20<br><br>$special = [^$lowAscii $lowSymbol]<br>

<br>lex :-<br><br>$special { Word }<br><br>{<br>data Token = Word AlexPosn ByteString.ByteString<br>}<br><br>When I run this through Alex, I get &quot;Prelude.Enum.Char.pred: bad argument&quot;.<br><br>What am I doing wrong? How would I accomplish this sort of thing? Thanks. --Omari<br>

</blockquote></div><br>