# Stuck at stage #mp7 for interpreter

**URL:** <https://forum.codecrafters.io/t/stuck-at-stage-mp7-for-interpreter/953>\
**Category:** Challenges\
**Tags:** challenge:interpreter\
**Created:** [July 6, 2024, 11:41am UTC](https://forum.codecrafters.io/t/stuck-at-stage-mp7-for-interpreter/953 "2024-07-06T11:41:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![0xdeathbed](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/0xdeathbed/32/877_2.png) [@0xdeathbed](https://forum.codecrafters.io/u/0xdeathbed)\
**Post date:** [July 6, 2024, 11:41am UTC](https://forum.codecrafters.io/t/stuck-at-stage-mp7-for-interpreter/953/1 "2024-07-06T11:41:31Z")

</div>

I’m stuck on Stage #MP7.

Apparently on codetesters test either first line of output is missing or something else is going

Here are my logs:

```auto
Running tests. Logs should appear shortly...

[tester::#MP7] Running tests for Stage #MP7 (Scanning: Assignment & equality Operators)
[tester::#MP7] [test-1] Running test case: 1
[tester::#MP7] [test-1] Writing contents to ./test.lox:
[tester::#MP7] [test-1] [test.lox] =
[tester::#MP7] [test-1] $ ./your_program.sh tokenize test.lox
[your_program] EOF null
[tester::#MP7] [test-1] 𐄂 EOF null
[tester::#MP7] [test-1] Expected line #1 on stdout to be "EQUAL = null", got "EOF null"
[tester::#MP7] [test-1] Test failed (try setting 'debug: true' in your codecrafters.yml to see more details)

```

But for same content on my test.lox it gives following locally:

```auto
$ ./your_program.sh tokenize test.lox
EQUAL = null
EOF null

```

test.lox content:

```auto
$ cat test.lox
=

```

And all tokens are printed using println!() including EOF

```rust
for token in &self.tokens {
   println!("{}", token.ttype.describe());
}

```

---

<div class="post-metadata">

**Author:** ![rohitpaulk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rohitpaulk/32/6_2.png) [@rohitpaulk](https://forum.codecrafters.io/u/rohitpaulk)\
**Post date:** [July 9, 2024, 8:43am UTC](https://forum.codecrafters.io/t/stuck-at-stage-mp7-for-interpreter/953/2 "2024-07-09T08:43:46Z")

</div>

Just tried your code locally and I see the same result, super weird - we’ll look into this!

---

<div class="post-metadata">

**Author:** ![glokta1](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/glokta1/32/701_2.png) [@glokta1](https://forum.codecrafters.io/u/glokta1)\
**Post date:** [July 15, 2024, 9:43am UTC](https://forum.codecrafters.io/t/stuck-at-stage-mp7-for-interpreter/953/3 "2024-07-15T09:43:37Z")

</div>

I think you might be accidentally appending a newline character in your local `test.lox` file.

We don’t do that in the tester, hence the disparity in outputs 🙂

Unfortunately, we can’t change this since white space is a separate stage altogether and doing it earlier would violate with what the book dictates.

---

<div class="post-metadata">

**Author:** ![0xdeathbed](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/0xdeathbed/32/877_2.png) [@0xdeathbed](https://forum.codecrafters.io/u/0xdeathbed)\
**Post date:** [July 15, 2024, 11:22am UTC](https://forum.codecrafters.io/t/stuck-at-stage-mp7-for-interpreter/953/4 "2024-07-15T11:22:50Z")

</div>

Thanks, it got my attention that when i have only one character i was peeking which was resulting in skipping.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [July 20, 2024, 11:23am UTC](https://forum.codecrafters.io/t/stuck-at-stage-mp7-for-interpreter/953/5 "2024-07-20T11:23:04Z")

</div>

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