When the second test runs for the topic ‘scanning identifiers’, the test fails on there parts: 6ar, 6az
expected exit code 0, got 65
however these shouldn’t be valid.
remote: [tester::#EY7 ] [test-2] [test.lox] _123foo _hello 6ar f00 6az
remote: [tester::#EY7 ] [test-2] $ ./your_program.sh tokenize test.lox
remote: [your_program] [line 1] Error: Unexpected character: 6
remote: [your_program] [line 1] Error: Unexpected character: 6
remote: [your_program] IDENTIFIER _123foo null
remote: [your_program] IDENTIFIER _hello null
remote: [your_program] IDENTIFIER f00 null
remote: [your_program] EOF null
remote: [tester::#EY7 ] [test-2] expected exit code 0, got 65
remote: [tester::#EY7 ] [test-2] Test failed
andy1li
October 28, 2024, 12:46pm
3
@JohannesCleve I tried running your code, but it’s not passing the previous stage: Scanning: Number literals #kj0 .
It’s common for later changes to inadvertently break earlier stages, so resolving this might help you progress smoothly through the current stage.
Thanks for the tip.
I made some changes which fixes the previous tests, but it still fails on that same test.
@JohannesCleve Sorry, I reread your original post and realized I misunderstood it.
however these shouldn’t be valid.
You’re correct – 6ar and 6az aren’t valid identifiers. However, they should be parsed as a number followed by a valid identifier.
Could you try updating your code with this parsing approach and see if it resolves the issue? Let me know if you need further help!
Thanks for you help. All tests are passing now.
The confusion was a bit around the scanning of “6az”. I thought that for 6 to be considered a number that I should be followed by a space/tab/newline. So I considered “6az” to be an error.
1 Like
system
Closed
November 4, 2024, 11:26am
8
This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.