Test error in expected identifiers and numbers

I’ve passed the stage #EY7 Scanning: Identifiers

But there is an error in the test workflow of this step. On the first hand, I think it’s a very weird choice to allow number in identifiers but, ok. The problem is that in this test, the workflow expects a token NUMBER 6 6.0 instead of an IDENTIFIER 6az null. This is not coherent with the expectation of other tests.

remote: [tester::#EY7] [test-2] Running test case: 2                                                                                                                                                                                                                                                         
remote: [tester::#EY7] [test-2] Writing contents to ./test.lox:                                                                                                                                                                                                                                              
remote: [tester::#EY7] [test-2.lox] _123world_ foo f00 baz 6az
remote: [tester::#EY7] [test-2] $ ./your_program.sh tokenize test.lox                                                                                                                                                                                                                                        
remote: [your_program] IDENTIFIER _123world_ null
remote: [your_program] IDENTIFIER foo null
remote: [your_program] IDENTIFIER f00 null
remote: [your_program] IDENTIFIER baz null
remote: [your_program] IDENTIFIER 6az null
remote: [your_program] EOF  null
remote: [tester::#EY7] [test-2] ✓ IDENTIFIER _123world_ null                                                                                                                                                                                                                                                 
remote: [tester::#EY7] [test-2] ✓ IDENTIFIER foo null                                                                                                                                                                                                                                                        
remote: [tester::#EY7] [test-2] ✓ IDENTIFIER f00 null                                                                                                                                                                                                                                                        
remote: [tester::#EY7] [test-2] ✓ IDENTIFIER baz null                                                                                                                                                                                                                                                        
remote: [tester::#EY7] [test-2] 𐄂 IDENTIFIER 6az null                                                                                                                                                                                                                                                       
remote: [tester::#EY7] [test-2] Expected line #5 on stdout to be "NUMBER 6 6.0", got "IDENTIFIER 6az null"                                                                                                                                                                                                   
remote: [tester::#EY7] [test-2] Test failed   

Hey @hamster-966, 6az is an edge case that your interpreter should handle.

Since identifiers can’t start with a digit, 6az shouldn’t be treated as a single identifier. Instead, it should be parsed as a NUMBER 6 6.0 followed by IDENTIFIER az null.

For context, our tester has been validated against the official Lox implementation, so this behavior is consistent with the reference.

Let me know if you’d like further clarification!

Closing this thread due to inactivity. If you still need assistance, feel free to reopen or start a new discussion!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.