Course compiler and OutputTest do not agree on handling of "\" literals

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Course compiler and OutputTest do not agree on handling of "\" literals

gcpd
Course compiler appears to entirely swallow a single literal "\" char (no VM code emitted) unless it is escaped as "\\" but only a literal "\" is used in OutputTest. I could not at a glance find any mention of control chars in the Jack spec for strings so balance of probability is that this is an implementation error in the compiler itself.

In the 2nd edition of the book in Appendix 5 ordinal 47 and 92 are both described as "/" when it was probably intended to be "\" for 92.

Steps to reproduce:
- Copy tools/OS/*.vm to projects/12/OutputTest
- Compile projects/12/ArrayTest/Main.jack with JackCompiler
- Run OutputTest folder with VMEmulator

This is with the "legacy" software suite v2.7