sprhawk / python-on-a-chip

Automatically exported from code.google.com/p/python-on-a-chip
Other
0 stars 0 forks source link

Fix vm so ipm doesn't print extra space or extra line #119

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following interactive session shows an unnecessary space in the first 
column and an unnecessary newline::

ipm> import sys
ipm> sys.heap()
 (2244, 8192)
ipm> sys.gc()

ipm> 

Both unnecessary items should be eliminated so the output is prettier.

Original issue reported on code.google.com by dwhall...@gmail.com on 5 Aug 2010 at 5:55

GoogleCodeExporter commented 9 years ago
r564
- Created global to track when a soft space is needed (between successive 
PRINT_ITEMs)
- Changed PRINT_ITEM to print space only when needed
- Created global to track when something has been printed since the last newline
- Changed PRINT_NEWLINE to print newline only when needed
- Had to change src/lib/ipm.py to remove a print statement there which messed 
up the state of the global that remembers when something printed.

It's not possible to make regression tests for print output.
I tested manually on ipm.
All tests pass.
Mainlined directly.

Original comment by dwhall...@gmail.com on 5 Aug 2010 at 6:44