fix: add :eof to the terminator list in parse_stab_expression/1#92
Conversation
test/spitfire_test.exs
Outdated
| end | ||
|
|
||
| test "prefix stab expression does not exhaust fuel" do | ||
| assert Spitfire.parse("-> a") == |
There was a problem hiding this comment.
Tests for valid code should assert it's the same as Code.string_to_quoted. There's a helper function for it you can see in other tests.
There was a problem hiding this comment.
I have removed the test, as it is not valid Elixir and Code.string_to_quoted returns an error. What i'm testing is just that we don't hit an infinite loop or exhaust the fuel. So the second test should be enough.
8cc0dc7 to
d255f32
Compare
|
It's not, even with #93 on main we still get an infinite loop without the fix in this pr |
|
@rma97 could you rebase this on main and then I think we can merge |
d255f32 to
a1fb50c
Compare
remove test fix test
a1fb50c to
2105d3a
Compare
done |
|
@doorgan I would love to help with both spitfire and expert, so I was wondering if you could use the "good first issue" tag or something like it, to easier ease into the codebase :) |
resolves #90
As I understand, the problems lies in the terminating list when doing
while2.In the given example in the issue, the loop continues, peek becomes
->, thenc, then:eof. At that point, without:eofin the terminator list, the loop would continue infinitely.If im completely off, feel free to close this PR.
Keep up the good work!