diff --git a/note/answers/chapter08_statements.md b/note/answers/chapter08_statements.md index 87fe3f840..68a9be5a3 100644 --- a/note/answers/chapter08_statements.md +++ b/note/answers/chapter08_statements.md @@ -84,7 +84,9 @@ hadError = false; System.out.print("> "); - Scanner scanner = new Scanner(reader.readLine()); + String line = reader.readLine(); + if (line == null) break; + Scanner scanner = new Scanner(line); List tokens = scanner.scanTokens(); Parser parser = new Parser(tokens); @@ -102,6 +104,8 @@ } } } + + System.out.println(); } ```