[m-dev.] lexing min_int

Peter Wang novalazy at gmail.com
Wed Jan 18 16:57:18 AEDT 2012


I was trying to serialise a structure with io.write and reading it back
with io.read.  The latter part fails when the structure (sparse_bitset
in my case) contains an integer with value min_int.  That is written as
a negative decimal integer but is lexed as a minus sign followed by a
positive integer which is one bigger than max_int.

The best solution I can think of is to make lexer.m treat the most
negative integer literal as a special case, and return it as a single
token.integer token with a negative value.

Any other suggestions?

mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au

More information about the developers mailing list