Don't understand the expected solution on stage #ER2

I’m stuck on Stage #ER2.

I don’t understand why the expected solution for the test-2 in #ER2 have a single EOF while we have two lines :

[tester::#ER2] [test-2] Running test case: 2
[tester::#ER2] [test-2] Writing contents to ./test.lox:
[tester::#ER2] [test-2] [test.lox]  <|TAB|>
[tester::#ER2] [test-2] [test.lox] <|SPACE|>
[tester::#ER2] [test-2] $ ./your_program.sh tokenize test.lox
[your_program] Logs from your program will appear here!
[your_program] EOF  null
[your_program] EOF  null
[tester::#ER2] [test-2] ✓ EOF  null
[tester::#ER2] [test-2] ! EOF  null
[tester::#ER2] [test-2] Expected last stdout line to be "EOF  null", but found extra line: "EOF  null"
[tester::#ER2] [test-2] Test failed

EOF stands for “end of file” - it’s only expected that one EOF token is emitted for every file parsed.

Hello :innocent:

As per my knowledge, This could be due to an extra newline or an additional EOF being printed.

Make sure your program only outputs “EOF null” once. Check your code for any loops or conditions that might cause the EOF message to print multiple times. If you’re using a loop to read the file, ensure it terminates correctly after the first EOF.

I hope this will help you. :heart_eyes:

Respected community member :smiling_face_with_three_hearts:

Thank you, I don’t know why I thought that EOF was for end of line lol.

Yes indeed, I print EOF at each end of line but it’s just end of line.

Thanks for your help =)