Skip to content

Optional markers are awkward to use #19

@not-my-profile

Description

@not-my-profile

marked-yaml currently uses the following type for spans:

pub struct Span {
    start: Option<Marker>,
    end: Option<Marker>,
}

Span::new_blank() says:

Sometimes we simply do not know where information came from (for example if it was created by software) and in that case we can create a blank span.

In my use case I'm however only ever using marked-yaml to parse YAML provided from the user, so the spans can always be known, yet the API currently forces me to litter my code with .unwrap(), which is rather awkward. I think a much more elegant way of modelling software-generated nodes would be to simply use a different source index for their markers.

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