Open not-my-profile opened 1 month ago
Having recently worked on something with spans where I knew it would have marks, I agree that this isn't particularly pleasant. Perhaps we could reserve usize::MAX for the synthetic "unknown" marks. Do you fancy prototyping a branch to do this?
marked-yaml currently uses the following type for spans:
Span::new_blank()
says: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.