Unable to exit with expected code in Gleam

I am stuck on Stage #EA6 using gleam, I cannot exit with code 65:

[tester::#EA6] Running tests for Stage #EA6 (Scanning: Lexical errors)
[tester::#EA6] [test-1] Running test case: 1
[tester::#EA6] [test-1] Writing contents to ./test.lox:
[tester::#EA6] [test-1] [test.lox] @
[tester::#EA6] [test-1] $ ./your_program.sh tokenize test.lox
[your_program]    Compiled in 0.02s
[your_program]     Running main.main
[your_program] [line 1] Error: Unexpected character: @
[your_program] EOF  null
[tester::#EA6] [test-1] expected exit code 65, got 0
[tester::#EA6] [test-1] Test failed (try setting 'debug: true' in your codecrafters.yml to see more details)

I check the solutions in this topic, but they dont work for me.

Hi @Frid-Yuandu, there’re two issues:

  1. This does not seem correct:
      case errors {
        [] -> exit(65)
        _ -> Nil
      }
  1. Please use this line in your_program.sh and .codecrafters/run.sh:
exec gleam run --module main -- "$@"

Thanks for pointing out the first issue, and the run script works now, thx :slight_smile:

1 Like

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