Skip to content

Clarify edge cases when parse_ion encounters something that looks like a system value #365

@popematt

Description

@popematt

The parse_ion macro must always produce user values, but there are some edge cases to work out.

  • parse_ion doesn't (and shouldn't) know at what depth it was invoked, so anything in its output that looks like a system value must be annotated with $ion_literal
  • practically speaking, it might be easier to say that the parse_ion reader does not perform the step of removing $ion_literal from the expanded values so anything that is annotated with $ion_literal in the embedded document will also be annotated with $ion_literal in the expansion. However, this is subtly different because it means that $ion_literal::1 will be passed through the expansion as-is, whereas if we say that the parse_ion expansion annotates anything that looks like a system value, then it would be read as 1 and put into the expansion output as 1.
  • This may lead to unexpected behavior, depending on the resolution of Document $ion_literal and work out edge cases. #322. If parse_ion is invoked in a container, will the user expect to see $ion_literal annotations in the result?

The questions that need to be answered are:

  • Can we define parse_ion such that it just passes through all $ion_literal annotations? (Instead of having to determine whether a value looks like a system value)?
  • Can Document $ion_literal and work out edge cases. #322 be resolved in a way such that $ion_literal to be treated the same at any depth—not just at the top level?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions