Skip to content

Dead / duplicated code in is_complete() #61

@MrMino

Description

@MrMino

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>'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions