Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dead / duplicated code in is_complete() #61

Open
MrMino opened this issue Apr 13, 2020 · 0 comments
Open

Dead / duplicated code in is_complete() #61

MrMino opened this issue Apr 13, 2020 · 0 comments

Comments

@MrMino
Copy link

MrMino commented Apr 13, 2020

Hi

I'm going through the code in order to educate myself on how these parsers work, and I think I've noticed some dead code in is_complete function:

*ret = -2;
return NULL;
}

The while loop above can only terminate from:

Is this really unreachable or am I missing something? Is there a reason for this code to be there?

Also, given that EXPECT_CHAR already contains CHECK_EOF, and CHECK_EOF doesn't mutate any state, line 207 duplicates line 206, making the routine check for EOF twice in a row, when *buf == '<CR>'.

@MrMino MrMino changed the title Last two lines of is_complete() - dead code? Dead / duplicated code in is_complete() Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant