Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

[edn] Expose line/column/character span position information from parsed EDN streams #258

@ncalexan

Description

@ncalexan

This ticket tracks including line/column/character position information with parsed edn::Value trees. It addresses #149 (comment); it is a pre-requisite, I think, for #168.

Concretely, I think we want a pair type like:

struct edn::ValueAndSpan {
  value: edn::Value,
  span: edn::Span,
}

which encapsulates a Span of some description coming out of the PEG EDN parser. Sadly, this means we'll need to rewrite or duplicate the edn::Value type to have edn::ValueAndSpan children. I could imagine something like:

  • edn::Value<V>, where V parameterizes the children (so V = edn::Value is what we have now)

or something like

  • edn::Value<S>, where S parameterizes the span (so S = () is what we have now).

We'll want to expose this new type, and probably convert to the existing type as well (just dropping all the spans).

This is pretty awkward -- better suggestions appreciated. This could be a good first bug if the patch doesn't try to change existing code too much (i.e., just adds new types and conversions into existing types).

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions