Skip to content

Parser is quite confusing and needs cleanup. #7

@AiredaleDev

Description

@AiredaleDev

Presently, I find it difficult to predict weird side-effects I make to the algorithm. I think my confusion while writing it comes through to anyone reading it.

I think I just got tunnel-vision on "completing it at all costs," which prevented me from taking a step back and seeing the more obvious problems with the implementation. The main right now is that expressions that require matching multiple tokens (like name: type) are not handled on their own path which simply matches multiple tokens (or rather, I don't look ahead when I should be). This would remove the part of the algorithm that "rewinds" the tokenstream.

Moreover, the logic for stop_at for parse_stmt and parse_expr is also difficult to track.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions