Skip to content

Should empty nodes be allowed? #10

@matklad

Description

@matklad

In principle, it is possible to have nodes of length zero: this would be an internal node without children.

However such nodes are annoying to work with. For example, with empty nodes there maybe arbitrary number of nodes at a given offset (as opposed to at most two for non-empty nodes). So it seems a great idea to forbid this node.

That means that care must be taken to parse stuff like use foo::92; without empty nodes: we know that there should be a path segment after ::, but we shouldn't create a node for it unconditionally.

A funny edge case here is an empty file: We'll have to create a file node for it, and it will be empty.

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