Summary
A small enhancement to Jlox's GenerateAST functionality in indentation handling.
Problem
In the existing implementation, indentation within printed output was achieved by manually adding spaces before each string.
Solution
To address this issue, I introduced an indentation level variable that dynamically controls the number of spaces prefixed to strings during printing. This method allows for consistent and easily adjustable indentation.
Thanks, but I think the current code is OK as it is. Also your reformatting of the file breaks the HTML generator that weaves the code snippets into the book.
Summary A small enhancement to Jlox's GenerateAST functionality in indentation handling.
Problem In the existing implementation, indentation within printed output was achieved by manually adding spaces before each string.
Solution To address this issue, I introduced an indentation level variable that dynamically controls the number of spaces prefixed to strings during printing. This method allows for consistent and easily adjustable indentation.