Basic: add read-file. Misc basicpp space savings.
authorJoel Martin <github@martintribe.org>
Mon, 24 Oct 2016 03:18:08 +0000 (22:18 -0500)
committerJoel Martin <github@martintribe.org>
Mon, 24 Oct 2016 03:18:08 +0000 (22:18 -0500)
commit0e508fa51801b451e6a8968c6707eef13f5a603e
tree3e9cb3f395c164d3b1ca146a27ca0f4513683c69
parentbbab5c5d380886e0a59eff17599a0dc51b075c33
Basic: add read-file. Misc basicpp space savings.

- Add read-file which is similar to read-string but from a file name
  rather than a string. This allows steps 0-2 to load although each
  one eventuall crashes with out of memory after evaluating "123"
  a few times.
- basicpp:
    - Renumber the line numbers so they are ordinally increasing. This
      saves 150 or so bytes because GOTO/GOSUB calls have smaller line
      numbers.
    - Shrink 'IF 123' -> 'IF123' for almost 300 byte savings.[:w
    - Simplify PR_MEMORY_SUMMARY output. Save 75 bytes
- Add missing runtest.py change that allows basic tests to pass.
15 files changed:
basic/basicpp.py
basic/core.in.bas
basic/debug.in.bas
basic/reader.in.bas
basic/step4_if_fn_do.in.bas
basic/step5_tco.in.bas
basic/step6_file.in.bas
basic/step7_quote.in.bas
basic/step8_macros.in.bas
basic/step9_try.in.bas
basic/stepA_mal.in.bas
basic/types.in.bas
basic/variables.txt
core.mal
runtest.py