Fix stdio_in_num() and stdio_in_ascii()
commit47236b30f1180ff5140c2a45bc99244a6f73296f
authorMark Glines <mark@glines.org>
Wed, 23 Jul 2008 13:36:30 +0000 (23 06:36 -0700)
committerMark Glines <mark@glines.org>
Wed, 23 Jul 2008 13:36:30 +0000 (23 06:36 -0700)
treeb5fb49a25253a9be40ce6ef3439122da0f330c8e
parent6245b5bd0d2eb974eda42351fa0369a12b0e6721
Fix stdio_in_num() and stdio_in_ascii()

* they need to reflect when an EOF is encountered.
* they should not store input overflow in the IP, because that
  breaks concurrent access.

I am moving the stdin handling into the Interpreter module, so the
overflow is accessible to all IPs.  I am also using sysread to only
read one byte at a time, to minimize issues with multiple
interpreters running in the same process.

(I don't think it is possible to eliminate such issues, because
stdio_in_num() needs to read ahead to find the first non-digit,
and that extra character still needs to be stored somewhere.)
lib/Language/Befunge/IP.pm
lib/Language/Befunge/Interpreter.pm
lib/Language/Befunge/Ops.pm
t/1-classes/ip.t